Java javax.swing JSlider fields, constructors, methods, implement or subclass

Example usage for Java javax.swing JSlider fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.swing JSlider.

The text is from its open source code.

Subclass

javax.swing.JSlider has subclasses.
Click this link to see all its subclasses.

Constructor

JSlider(int orientation)
Creates a slider using the specified orientation with the range 0 to 100 and an initial value of 50 .
JSlider(BoundedRangeModel brm)
Creates a horizontal slider using the specified BoundedRangeModel.
JSlider()
Creates a horizontal slider with the range 0 to 100 and an initial value of 50.
JSlider(int min, int max, int value)
Creates a horizontal slider using the specified min, max and value.
JSlider(int orientation, int min, int max, int value)
Creates a slider with the specified orientation and the specified minimum, maximum, and initial values.
JSlider(int min, int max)
Creates a horizontal slider using the specified min and max with an initial value equal to the average of the min plus max.

Method

voidaddChangeListener(ChangeListener l)
Adds a ChangeListener to the slider.
voidaddMouseListener(MouseListener l)
Adds the specified mouse listener to receive mouse events from this component.
voidaddMouseWheelListener(MouseWheelListener l)
Adds the specified mouse wheel listener to receive mouse wheel events from this component.
voidaddPropertyChangeListener(PropertyChangeListener listener)
Adds a PropertyChangeListener to the listener list.
HashtablecreateStandardLabels(int increment, int start)
Creates a Hashtable of numerical text labels, starting at the starting point specified, and using the increment specified.
HashtablecreateStandardLabels(int increment)
Creates a Hashtable of numerical text labels, starting at the slider minimum, and using the increment specified.
booleanequals(Object obj)
Indicates whether some other object is "equal to" this one.
intgetExtent()
Returns the "extent" from the BoundedRangeModel.
DictionarygetLabelTable()
Returns the dictionary of what labels to draw at which values.
intgetMajorTickSpacing()
This method returns the major tick spacing.
intgetMaximum()
Returns the maximum value supported by the slider from the BoundedRangeModel.
intgetMinimum()
Returns the minimum value supported by the slider from the BoundedRangeModel.
BoundedRangeModelgetModel()
Returns the BoundedRangeModel that handles the slider's three fundamental properties: minimum, maximum, value.
StringgetName()
Gets the name of the component.
intgetOrientation()
Return this slider's vertical or horizontal orientation.
booleangetPaintTicks()
Tells if tick marks are to be painted.
DimensiongetPreferredSize()
If the preferredSize has been set to a non-null value just returns it.
booleangetSnapToTicks()
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.
intgetValue()
Returns the slider's current value from the BoundedRangeModel .
booleangetValueIsAdjusting()
Returns the valueIsAdjusting property from the model.
voidputClientProperty(Object key, Object value)
Adds an arbitrary key/value "client property" to this component.
voidsetBackground(Color bg)
Sets the background color of this component.
voidsetBorder(Border border)
Sets the border of this component.
voidsetBounds(int x, int y, int width, int height)
Moves and resizes this component.
voidsetEnabled(boolean enabled)
Sets whether or not this component is enabled.
voidsetExtent(int extent)
Sets the size of the range "covered" by the knob.
voidsetFont(Font font)
voidsetInverted(boolean b)
Specify true to reverse the value-range shown for the slider and false to put the value range in the normal order.
voidsetLabelTable(Dictionary labels)
Used to specify what label will be drawn at any given value.
voidsetMajorTickSpacing(int n)
This method sets the major tick spacing.
voidsetMaximum(int maximum)
Sets the slider's maximum value to maximum .
voidsetMinimum(int minimum)
Sets the slider's minimum value to minimum .
voidsetMinimumSize(Dimension minimumSize)
Sets the minimum size of this component to a constant value.
voidsetMinorTickSpacing(int n)
This method sets the minor tick spacing.
voidsetName(String name)
Sets the name of the component to the specified string.
voidsetOpaque(boolean isOpaque)
If true the component paints every pixel within its bounds.
voidsetOrientation(int orientation)
Set the slider's orientation to either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL .
voidsetPaintLabels(boolean b)
Determines whether labels are painted on the slider.
voidsetPaintTicks(boolean b)
Determines whether tick marks are painted on the slider.
voidsetPaintTrack(boolean b)
Determines whether the track is painted on the slider.
voidsetPreferredSize(Dimension preferredSize)
Sets the preferred size of this component.
voidsetSnapToTicks(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.
voidsetValue(int n)
Sets the slider's current value to n .