
A JSlider can display optional tick marks and labels along its length. The paintT icks and
paintLabels pr operties specify whether they should be displayed. majorT ickSpacing and
minorT ickSpacing specify the spacing of long and short tick marks. Note that these spac-
ings are measur ed in the coordinate space defined by the JSlider minimum and maxi-
mum value; they are not pixel spacings. If the snapToT icks pr operty is set tr ue, the user
can only adjust the value pr operty to a value at which a tick mark appears. If you set
paintLabels and majorT ickSpacing, the JSlider automatically displays a numeric label for
each major tick mark. You can call createStandardLabels() to force this behavior, even
when tick marks are not displayed. You can also specify custom labels by setting the
labelTable pr operty to a java.util.Dictionar y that maps Integer coordinates to JComponent
labels.
A JSlider fir es a javax.swing .event.ChangeEvent when one of its value, maximum, minimum,
extent,orvalueIsAdjusting pr operties changes. If valueIsAdjusting is tr ue when an event is
fir ed, it means that the event is one of a series of changes. Listeners that do not want to
track these rapid-fire transient changes can ignore them.
public class JSlider extends JComponent implements Accessible, SwingConstants {
// Public Constructors
public JSlider();
public JSlider(BoundedRangeModel brm);
public JSlider(int orientation ...