I was using Netbeans GUI to create a JSlider. Then I added the ticks and max and min values as follows:
slider.setMinorTickSpacing(10);
slider.setMajorTickSpacing(20);
slider.setPaintTicks(true);Hashtable<Integer, JLabel> labels =
new Hashtable<Integer, JLabel>();
labels.put(0, new JLabel("0"));
labels.put(20, new JLabel("20"));
labels.put(40, new JLabel("40"));
labels.put(60, new JLabel("60"));
labels.put(80, new JLabel("80"));
labels.put(100, new JLabel("100"));
slider.setLabelTable(labels);
slider.setPaintLabels(true);
It was working fine until during one of the runs, half the numbers were hidden, as in 20, 40.. its not visible. But it is there. Here:
How do I correct this? This: https://docs.oracle.com/javase/tutorial/uiswing/components/slider.html tells nothing.