Module java.desktop
Package javax.swing

Class JSlider

java.lang.Object
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible, SwingConstants

@JavaBean(defaultProperty="UI", description="A component that supports selecting a integer value from a range.") public class JSlider extends JComponent implements SwingConstants, Accessible
A component that lets the user graphically select a value by sliding a knob within a bounded interval. The knob is always positioned at the points that match integer values within the specified interval.

The slider can show both major tick marks, and minor tick marks between the major ones. The number of values between the tick marks is controlled with setMajorTickSpacing and setMinorTickSpacing. Painting of tick marks is controlled by setPaintTicks.

Sliders can also print text labels at regular intervals (or at arbitrary locations) along the slider track. Painting of labels is controlled by setLabelTable and setPaintLabels.

For further information and examples see How to Use Sliders, a section in The Java Tutorial.

Warning: Swing is not thread safe. For more information see Swing's Threading Policy.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans package. Please see XMLEncoder.

Since:
1.2