The labels that are presented on the Slider can be changed. You can set the label according to you. The following code creates the slider and changes its labels :
Code:
JSlider framesPerSecond = new JSlider(JSlider.VERTICAL,
FPS_MIN, FPS_MAX, FPS_INIT);
framesPerSecond.addChangeListener(this);
framesPerSecond.setMajorTickSpacing(20);
framesPerSecond.setPaintTicks(true);
//Create the label table
Hashtable labelTable = new Hashtable();
labelTable.put( new Integer( 0 ), new JLabel("Halt") );
labelTable.put( new Integer( FPS_MAX/20 ), new JLabel("Steady") );
labelTable.put( new Integer( FPS_MAX ), new JLabel("Speed") );
framesPerSecond.setLabelTable( labelTable );
framesPerSecond.setPaintLabels(true);
Bookmarks