JSlider (Java Platform SE 8 ) (original) (raw)
Modifier and Type
Method
Description
void
[addChangeListener](../../javax/swing/JSlider.html#addChangeListener-javax.swing.event.ChangeListener-)([ChangeListener](../../javax/swing/event/ChangeListener.html "interface in javax.swing.event") l)
Adds a ChangeListener to the slider.
protected [ChangeListener](../../javax/swing/event/ChangeListener.html "interface in javax.swing.event")
[createChangeListener](../../javax/swing/JSlider.html#createChangeListener--)()
Subclasses that want to handle ChangeEvent
s from the model differently can override this to return an instance of a custom ChangeListener
implementation.
[Hashtable](../../java/util/Hashtable.html "class in java.util")
[createStandardLabels](../../javax/swing/JSlider.html#createStandardLabels-int-)(int increment)
Creates a Hashtable
of numerical text labels, starting at the slider minimum, and using the increment specified.
[Hashtable](../../java/util/Hashtable.html "class in java.util")
[createStandardLabels](../../javax/swing/JSlider.html#createStandardLabels-int-int-)(int increment, int start)
Creates a Hashtable
of numerical text labels, starting at the starting point specified, and using the increment specified.
protected void
[fireStateChanged](../../javax/swing/JSlider.html#fireStateChanged--)()
Send a ChangeEvent
, whose source is this JSlider
, to all ChangeListener
s that have registered interest inChangeEvent
s.
[AccessibleContext](../../javax/accessibility/AccessibleContext.html "class in javax.accessibility")
[getAccessibleContext](../../javax/swing/JSlider.html#getAccessibleContext--)()
Gets the AccessibleContext associated with this JSlider.
[ChangeListener](../../javax/swing/event/ChangeListener.html "interface in javax.swing.event")[]
[getChangeListeners](../../javax/swing/JSlider.html#getChangeListeners--)()
Returns an array of all the ChangeListener
s added to this JSlider with addChangeListener().
int
[getExtent](../../javax/swing/JSlider.html#getExtent--)()
Returns the "extent" from the BoundedRangeModel
.
boolean
[getInverted](../../javax/swing/JSlider.html#getInverted--)()
Returns true if the value-range shown for the slider is reversed,
[Dictionary](../../java/util/Dictionary.html "class in java.util")
[getLabelTable](../../javax/swing/JSlider.html#getLabelTable--)()
Returns the dictionary of what labels to draw at which values.
int
[getMajorTickSpacing](../../javax/swing/JSlider.html#getMajorTickSpacing--)()
This method returns the major tick spacing.
int
[getMaximum](../../javax/swing/JSlider.html#getMaximum--)()
Returns the maximum value supported by the slider from the BoundedRangeModel
.
int
[getMinimum](../../javax/swing/JSlider.html#getMinimum--)()
Returns the minimum value supported by the slider from the BoundedRangeModel
.
int
[getMinorTickSpacing](../../javax/swing/JSlider.html#getMinorTickSpacing--)()
This method returns the minor tick spacing.
[BoundedRangeModel](../../javax/swing/BoundedRangeModel.html "interface in javax.swing")
[getModel](../../javax/swing/JSlider.html#getModel--)()
Returns the BoundedRangeModel
that handles the slider's three fundamental properties: minimum, maximum, value.
int
[getOrientation](../../javax/swing/JSlider.html#getOrientation--)()
Return this slider's vertical or horizontal orientation.
boolean
[getPaintLabels](../../javax/swing/JSlider.html#getPaintLabels--)()
Tells if labels are to be painted.
boolean
[getPaintTicks](../../javax/swing/JSlider.html#getPaintTicks--)()
Tells if tick marks are to be painted.
boolean
[getPaintTrack](../../javax/swing/JSlider.html#getPaintTrack--)()
Tells if the track (area the slider slides in) is to be painted.
boolean
[getSnapToTicks](../../javax/swing/JSlider.html#getSnapToTicks--)()
Returns true if the knob (and the data value it represents) resolve to the closest tick mark next to where the user positioned the knob.
[SliderUI](../../javax/swing/plaf/SliderUI.html "class in javax.swing.plaf")
[getUI](../../javax/swing/JSlider.html#getUI--)()
Gets the UI object which implements the L&F for this component.
[String](../../java/lang/String.html "class in java.lang")
[getUIClassID](../../javax/swing/JSlider.html#getUIClassID--)()
Returns the name of the L&F class that renders this component.
int
[getValue](../../javax/swing/JSlider.html#getValue--)()
Returns the slider's current value from the BoundedRangeModel
.
boolean
[getValueIsAdjusting](../../javax/swing/JSlider.html#getValueIsAdjusting--)()
Returns the valueIsAdjusting
property from the model.
boolean
[imageUpdate](../../javax/swing/JSlider.html#imageUpdate-java.awt.Image-int-int-int-int-int-)([Image](../../java/awt/Image.html "class in java.awt") img, int infoflags, int x, int y, int w, int h)
Repaints the component when the image has changed.
protected [String](../../java/lang/String.html "class in java.lang")
[paramString](../../javax/swing/JSlider.html#paramString--)()
Returns a string representation of this JSlider.
void
[removeChangeListener](../../javax/swing/JSlider.html#removeChangeListener-javax.swing.event.ChangeListener-)([ChangeListener](../../javax/swing/event/ChangeListener.html "interface in javax.swing.event") l)
Removes a ChangeListener from the slider.
void
[setExtent](../../javax/swing/JSlider.html#setExtent-int-)(int extent)
Sets the size of the range "covered" by the knob.
void
[setFont](../../javax/swing/JSlider.html#setFont-java.awt.Font-)([Font](../../java/awt/Font.html "class in java.awt") font)
Sets the font for this component.
void
[setInverted](../../javax/swing/JSlider.html#setInverted-boolean-)(boolean b)
Specify true to reverse the value-range shown for the slider and false to put the value range in the normal order.
void
[setLabelTable](../../javax/swing/JSlider.html#setLabelTable-java.util.Dictionary-)([Dictionary](../../java/util/Dictionary.html "class in java.util") labels)
Used to specify what label will be drawn at any given value.
void
[setMajorTickSpacing](../../javax/swing/JSlider.html#setMajorTickSpacing-int-)(int n)
This method sets the major tick spacing.
void
[setMaximum](../../javax/swing/JSlider.html#setMaximum-int-)(int maximum)
Sets the slider's maximum value to maximum
.
void
[setMinimum](../../javax/swing/JSlider.html#setMinimum-int-)(int minimum)
Sets the slider's minimum value to minimum
.
void
[setMinorTickSpacing](../../javax/swing/JSlider.html#setMinorTickSpacing-int-)(int n)
This method sets the minor tick spacing.
void
[setModel](../../javax/swing/JSlider.html#setModel-javax.swing.BoundedRangeModel-)([BoundedRangeModel](../../javax/swing/BoundedRangeModel.html "interface in javax.swing") newModel)
Sets the BoundedRangeModel
that handles the slider's three fundamental properties: minimum, maximum, value.
void
[setOrientation](../../javax/swing/JSlider.html#setOrientation-int-)(int orientation)
Set the slider's orientation to either SwingConstants.VERTICAL
orSwingConstants.HORIZONTAL
.
void
[setPaintLabels](../../javax/swing/JSlider.html#setPaintLabels-boolean-)(boolean b)
Determines whether labels are painted on the slider.
void
[setPaintTicks](../../javax/swing/JSlider.html#setPaintTicks-boolean-)(boolean b)
Determines whether tick marks are painted on the slider.
void
[setPaintTrack](../../javax/swing/JSlider.html#setPaintTrack-boolean-)(boolean b)
Determines whether the track is painted on the slider.
void
[setSnapToTicks](../../javax/swing/JSlider.html#setSnapToTicks-boolean-)(boolean b)
Specifying true makes the knob (and the data value it represents) resolve to the closest tick mark next to where the user positioned the knob.
void
[setUI](../../javax/swing/JSlider.html#setUI-javax.swing.plaf.SliderUI-)([SliderUI](../../javax/swing/plaf/SliderUI.html "class in javax.swing.plaf") ui)
Sets the UI object which implements the L&F for this component.
void
[setValue](../../javax/swing/JSlider.html#setValue-int-)(int n)
Sets the slider's current value to n
.
void
[setValueIsAdjusting](../../javax/swing/JSlider.html#setValueIsAdjusting-boolean-)(boolean b)
Sets the model's valueIsAdjusting
property.
protected void
[updateLabelUIs](../../javax/swing/JSlider.html#updateLabelUIs--)()
Updates the UIs for the labels in the label table by callingupdateUI
on each label.
void
[updateUI](../../javax/swing/JSlider.html#updateUI--)()
Resets the UI property to a value from the current look and feel.