2013-10-03 4 views

Répondre

4

Avec la méthode setLabelTable. Copier-coller à partir de the tutorial:

//Create the slider 
JSlider framesPerSecond = new JSlider(JSlider.VERTICAL, 
             FPS_MIN, FPS_MAX, FPS_INIT); 
... 

//Create the label table 
Hashtable labelTable = new Hashtable(); 
labelTable.put(new Integer(0), new JLabel("Stop")); 
labelTable.put(new Integer(FPS_MAX/10), new JLabel("Slow")); 
labelTable.put(new Integer(FPS_MAX), new JLabel("Fast")); 
framesPerSecond.setLabelTable(labelTable); 

framesPerSecond.setPaintLabels(true); 
+0

+1 pour le lien du didacticiel. – camickr

Questions connexes