Example usage for Java javax.swing JSlider fields, constructors, methods, implement or subclass
The text is from its open source code.
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. |
void | addChangeListener(ChangeListener l) Adds a ChangeListener to the slider. |
void | addMouseListener(MouseListener l) Adds the specified mouse listener to receive mouse events from this component. |
void | addMouseWheelListener(MouseWheelListener l) Adds the specified mouse wheel listener to receive mouse wheel events from this component. |
void | addPropertyChangeListener(PropertyChangeListener listener) Adds a PropertyChangeListener to the listener list. |
Hashtable | createStandardLabels(int increment, int start) Creates a Hashtable of numerical text labels, starting at the starting point specified, and using the increment specified. |
Hashtable | createStandardLabels(int increment) Creates a Hashtable of numerical text labels, starting at the slider minimum, and using the increment specified. |
boolean | equals(Object obj) Indicates whether some other object is "equal to" this one. |
int | getExtent() Returns the "extent" from the BoundedRangeModel . |
Dictionary | getLabelTable() Returns the dictionary of what labels to draw at which values. |
int | getMajorTickSpacing() This method returns the major tick spacing. |
int | getMaximum() Returns the maximum value supported by the slider from the BoundedRangeModel . |
int | getMinimum() Returns the minimum value supported by the slider from the BoundedRangeModel . |
BoundedRangeModel | getModel() Returns the BoundedRangeModel that handles the slider's three fundamental properties: minimum, maximum, value. |
String | getName() Gets the name of the component. |
int | getOrientation() Return this slider's vertical or horizontal orientation. |
boolean | getPaintTicks() Tells if tick marks are to be painted. |
Dimension | getPreferredSize() If the preferredSize has been set to a non-null value just returns it. |
boolean | 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. |
int | getValue() Returns the slider's current value from the BoundedRangeModel . |
boolean | getValueIsAdjusting() Returns the valueIsAdjusting property from the model. |
void | putClientProperty(Object key, Object value) Adds an arbitrary key/value "client property" to this component. |
void | setBackground(Color bg) Sets the background color of this component. |
void | setBorder(Border border) Sets the border of this component. |
void | setBounds(int x, int y, int width, int height) Moves and resizes this component. |
void | setEnabled(boolean enabled) Sets whether or not this component is enabled. |
void | setExtent(int extent) Sets the size of the range "covered" by the knob. |
void | setFont(Font font) |
void | setInverted(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(Dictionary labels) Used to specify what label will be drawn at any given value. |
void | setMajorTickSpacing(int n) This method sets the major tick spacing. |
void | setMaximum(int maximum) Sets the slider's maximum value to maximum . |
void | setMinimum(int minimum) Sets the slider's minimum value to minimum . |
void | setMinimumSize(Dimension minimumSize) Sets the minimum size of this component to a constant value. |
void | setMinorTickSpacing(int n) This method sets the minor tick spacing. |
void | setName(String name) Sets the name of the component to the specified string. |
void | setOpaque(boolean isOpaque) If true the component paints every pixel within its bounds. |
void | setOrientation(int orientation) Set the slider's orientation to either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL . |
void | setPaintLabels(boolean b) Determines whether labels are painted on the slider. |
void | setPaintTicks(boolean b) Determines whether tick marks are painted on the slider. |
void | setPaintTrack(boolean b) Determines whether the track is painted on the slider. |
void | setPreferredSize(Dimension preferredSize) Sets the preferred size of this component. |
void | setSnapToTicks(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 | setValue(int n) Sets the slider's current value to n . |