Home » openjdk-7 » javax » swing » [javadoc | source]
javax.swing
public class: JSlider [javadoc | source]
java.lang.Object
   java.awt.Component
      java.awt.Container
         javax.swing.JComponent
            javax.swing.JSlider

All Implemented Interfaces:
    SwingConstants, Accessible, HasGetTransferHandler, Serializable, MenuContainer, ImageObserver

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 {@code setPaintTicks}.

Sliders can also print text labels at regular intervals (or at arbitrary locations) along the slider track. Painting of labels is controlled by {@code setLabelTable} and {@code 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 JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder .

Nested Class Summary:
protected class  JSlider.AccessibleJSlider  This class implements accessibility support for the JSlider class. It provides an implementation of the Java Accessibility API appropriate to slider user-interface elements.

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 JavaBeansTM has been added to the java.beans package. Please see {@link java.beans.XMLEncoder}. 

Field Summary
protected  BoundedRangeModel sliderModel    The data model that handles the numeric maximum value, minimum value, and current-position value for the slider. 
protected  int majorTickSpacing    The number of values between the major tick marks -- the larger marks that break up the minor tick marks. 
protected  int minorTickSpacing    The number of values between the minor tick marks -- the smaller marks that occur between the major tick marks. 
protected  boolean snapToTicks    If true, the knob (and the data value it represents) resolve to the closest tick mark next to where the user positioned the knob. The default is false. 
 boolean snapToValue    If true, the knob (and the data value it represents) resolve to the closest slider value next to where the user positioned the knob. 
protected  int orientation    Whether the slider is horizontal or vertical The default is horizontal. 
protected  ChangeListener changeListener    The changeListener (no suffix) is the listener we add to the slider's model. This listener is initialized to the {@code ChangeListener} returned from {@code createChangeListener}, which by default just forwards events to {@code ChangeListener}s (if any) added directly to the slider. 
protected transient  ChangeEvent changeEvent    Only one ChangeEvent is needed per slider instance since the event's only (read-only) state is the source property. The source of events generated here is always "this". The event is lazily created the first time that an event notification is fired. 
Fields inherited from javax.swing.JComponent:
DEBUG_GRAPHICS_LOADED,  ui,  listenerList,  paintingChild,  WHEN_FOCUSED,  WHEN_ANCESTOR_OF_FOCUSED_COMPONENT,  WHEN_IN_FOCUSED_WINDOW,  UNDEFINED_CONDITION,  TOOL_TIP_TEXT_KEY,  focusController,  accessibleContext
Fields inherited from java.awt.Container:
layoutMgr,  containerListener,  listeningChildren,  listeningBoundsChildren,  descendantsCount,  preserveBackgroundColor,  INCLUDE_SELF,  SEARCH_HEAVYWEIGHTS,  modalComp,  modalAppContext
Fields inherited from java.awt.Component:
peer,  parent,  appContext,  x,  y,  width,  height,  foreground,  background,  font,  peerFont,  cursor,  locale,  bufferStrategy,  ignoreRepaint,  visible,  enabled,  dropTarget,  popups,  focusTraversalKeys,  LOCK,  minSize,  minSizeSet,  prefSize,  prefSizeSet,  maxSize,  maxSizeSet,  componentOrientation,  newEventsOnly,  componentListener,  focusListener,  hierarchyListener,  hierarchyBoundsListener,  keyListener,  mouseListener,  mouseMotionListener,  mouseWheelListener,  inputMethodListener,  windowClosingException,  actionListenerK,  adjustmentListenerK,  componentListenerK,  containerListenerK,  focusListenerK,  itemListenerK,  keyListenerK,  mouseListenerK,  mouseMotionListenerK,  mouseWheelListenerK,  textListenerK,  ownedWindowK,  windowListenerK,  inputMethodListenerK,  hierarchyListenerK,  hierarchyBoundsListenerK,  windowStateListenerK,  windowFocusListenerK,  eventMask,  isInc,  incRate,  TOP_ALIGNMENT,  CENTER_ALIGNMENT,  BOTTOM_ALIGNMENT,  LEFT_ALIGNMENT,  RIGHT_ALIGNMENT,  isPacked,  backgroundEraseDisabled,  eventCache,  accessibleContext
Constructor:
 public JSlider() 
 public JSlider(int orientation) 
 public JSlider(BoundedRangeModel brm) 
    Creates a horizontal slider using the specified BoundedRangeModel.
 public JSlider(int min,
    int max) 
 public JSlider(int min,
    int max,
    int value) 
 public JSlider(int orientation,
    int min,
    int max,
    int value) 
Method from javax.swing.JSlider Summary:
addChangeListener,   createChangeListener,   createStandardLabels,   createStandardLabels,   fireStateChanged,   getAccessibleContext,   getChangeListeners,   getExtent,   getInverted,   getLabelTable,   getMajorTickSpacing,   getMaximum,   getMinimum,   getMinorTickSpacing,   getModel,   getOrientation,   getPaintLabels,   getPaintTicks,   getPaintTrack,   getSnapToTicks,   getSnapToValue,   getUI,   getUIClassID,   getValue,   getValueIsAdjusting,   imageUpdate,   paramString,   removeChangeListener,   setExtent,   setFont,   setInverted,   setLabelTable,   setMajorTickSpacing,   setMaximum,   setMinimum,   setMinorTickSpacing,   setModel,   setOrientation,   setPaintLabels,   setPaintTicks,   setPaintTrack,   setSnapToTicks,   setSnapToValue,   setUI,   setValue,   setValueIsAdjusting,   updateLabelUIs,   updateUI
Methods from javax.swing.JComponent:
_paintImmediately,   addAncestorListener,   addNotify,   addVetoableChangeListener,   alwaysOnTop,   checkIfChildObscuredBySibling,   clientPropertyChanged,   compWriteObjectNotify,   componentInputMapChanged,   computeVisibleRect,   computeVisibleRect,   contains,   createToolTip,   disable,   dndDone,   dropLocationForPoint,   enable,   firePropertyChange,   firePropertyChange,   firePropertyChange,   fireVetoableChange,   getAccessibleContext,   getActionForKeyStroke,   getActionMap,   getActionMap,   getAlignmentX,   getAlignmentY,   getAncestorListeners,   getAutoscrolls,   getBaseline,   getBaselineResizeBehavior,   getBorder,   getBounds,   getClientProperty,   getComponentGraphics,   getComponentPopupMenu,   getConditionForKeyStroke,   getCreatedDoubleBuffer,   getDebugGraphicsOptions,   getDefaultLocale,   getFontMetrics,   getGraphics,   getGraphicsInvoked,   getHeight,   getInheritsPopupMenu,   getInputMap,   getInputMap,   getInputMap,   getInputVerifier,   getInsets,   getInsets,   getListeners,   getLocation,   getManagingFocusBackwardTraversalKeys,   getManagingFocusForwardTraversalKeys,   getMaximumSize,   getMinimumSize,   getNextFocusableComponent,   getPopupLocation,   getPreferredSize,   getRegisteredKeyStrokes,   getRootPane,   getSize,   getToolTipLocation,   getToolTipText,   getToolTipText,   getTopLevelAncestor,   getTransferHandler,   getUIClassID,   getVerifyInputWhenFocusTarget,   getVetoableChangeListeners,   getVisibleRect,   getWidth,   getWriteObjCounter,   getX,   getY,   grabFocus,   isDoubleBuffered,   isLightweightComponent,   isManagingFocus,   isOpaque,   isOptimizedDrawingEnabled,   isPainting,   isPaintingForPrint,   isPaintingOrigin,   isPaintingTile,   isRequestFocusEnabled,   isValidateRoot,   paint,   paintBorder,   paintChildren,   paintComponent,   paintForceDoubleBuffered,   paintImmediately,   paintImmediately,   paintToOffscreen,   paramString,   print,   printAll,   printBorder,   printChildren,   printComponent,   processComponentKeyEvent,   processKeyBinding,   processKeyBindings,   processKeyBindingsForAllComponents,   processKeyEvent,   processMouseEvent,   processMouseMotionEvent,   putClientProperty,   rectangleIsObscured,   registerKeyboardAction,   registerKeyboardAction,   removeAncestorListener,   removeNotify,   removeVetoableChangeListener,   repaint,   repaint,   requestDefaultFocus,   requestFocus,   requestFocus,   requestFocusInWindow,   requestFocusInWindow,   resetKeyboardActions,   reshape,   revalidate,   safelyGetGraphics,   safelyGetGraphics,   scrollRectToVisible,   setActionMap,   setAlignmentX,   setAlignmentY,   setAutoscrolls,   setBackground,   setBorder,   setComponentPopupMenu,   setCreatedDoubleBuffer,   setDebugGraphicsOptions,   setDefaultLocale,   setDoubleBuffered,   setDropLocation,   setEnabled,   setFocusTraversalKeys,   setFont,   setForeground,   setInheritsPopupMenu,   setInputMap,   setInputVerifier,   setMaximumSize,   setMinimumSize,   setNextFocusableComponent,   setOpaque,   setPaintingChild,   setPreferredSize,   setRequestFocusEnabled,   setToolTipText,   setTransferHandler,   setUI,   setUIProperty,   setVerifyInputWhenFocusTarget,   setVisible,   setWriteObjCounter,   shouldDebugGraphics,   superProcessMouseMotionEvent,   unregisterKeyboardAction,   update,   updateUI
Methods from java.awt.Container:
add,   add,   add,   add,   add,   addContainerListener,   addImpl,   addNotify,   addPropertyChangeListener,   addPropertyChangeListener,   adjustDecendantsOnParent,   adjustDescendants,   adjustListeningChildren,   applyComponentOrientation,   areFocusTraversalKeysSet,   canContainFocusOwner,   checkGD,   clearCurrentFocusCycleRootOnHide,   clearMostRecentFocusOwnerOnHide,   containsFocus,   countComponents,   countHierarchyMembers,   createChildHierarchyEvents,   createHierarchyEvents,   decreaseComponentCount,   deliverEvent,   dispatchEventImpl,   dispatchEventToSelf,   doLayout,   eventEnabled,   findComponentAt,   findComponentAt,   findComponentAt,   findComponentAtImpl,   getAccessibleAt,   getAccessibleChild,   getAccessibleChildrenCount,   getAlignmentX,   getAlignmentY,   getComponent,   getComponentAt,   getComponentAt,   getComponentCount,   getComponentZOrder,   getComponents,   getComponentsSync,   getComponents_NoClientCode,   getContainerListeners,   getDropTargetEventTarget,   getFocusTraversalKeys,   getFocusTraversalPolicy,   getHeavyweightContainer,   getInsets,   getLayout,   getListeners,   getMaximumSize,   getMinimumSize,   getMouseEventTarget,   getMousePosition,   getOpaqueShape,   getPreferredSize,   getTraversalRoot,   hasHeavyweightDescendants,   hasLightweightDescendants,   increaseComponentCount,   initializeFocusTraversalKeys,   insets,   invalidate,   invalidateParent,   invalidateTree,   isAncestorOf,   isFocusCycleRoot,   isFocusCycleRoot,   isFocusTraversalPolicyProvider,   isFocusTraversalPolicySet,   isRecursivelyVisibleUpToHeavyweightContainer,   isSameOrAncestorOf,   isValidateRoot,   layout,   lightweightPaint,   lightweightPrint,   list,   list,   locate,   minimumSize,   mixOnHiding,   mixOnReshaping,   mixOnShowing,   mixOnValidating,   mixOnZOrderChanging,   numListening,   paint,   paintComponents,   paintHeavyweightComponents,   paramString,   postProcessKeyEvent,   postsOldMouseEvents,   preProcessKeyEvent,   preferredSize,   print,   printComponents,   printHeavyweightComponents,   processContainerEvent,   processEvent,   proxyEnableEvents,   recursiveApplyCurrentShape,   recursiveApplyCurrentShape,   recursiveApplyCurrentShape,   recursiveSubtractAndApplyShape,   recursiveSubtractAndApplyShape,   recursiveSubtractAndApplyShape,   remove,   remove,   removeAll,   removeContainerListener,   removeNotify,   setComponentZOrder,   setFocusCycleRoot,   setFocusTraversalKeys,   setFocusTraversalPolicy,   setFocusTraversalPolicyProvider,   setFont,   setLayout,   transferFocusDownCycle,   update,   updateGraphicsData,   validate,   validateTree,   validateUnconditionally
Methods from java.awt.Component:
action,   add,   addComponentListener,   addFocusListener,   addHierarchyBoundsListener,   addHierarchyListener,   addInputMethodListener,   addKeyListener,   addMouseListener,   addMouseMotionListener,   addMouseWheelListener,   addNotify,   addPropertyChangeListener,   addPropertyChangeListener,   adjustListeningChildrenOnParent,   applyComponentOrientation,   applyCompoundShape,   applyCurrentShape,   areBoundsValid,   areFocusTraversalKeysSet,   areInputMethodsEnabled,   autoProcessMouseWheel,   bounds,   canBeFocusOwner,   canBeFocusOwnerRecursively,   checkGD,   checkImage,   checkImage,   checkTreeLock,   checkWindowClosingException,   clearCurrentFocusCycleRootOnHide,   clearMostRecentFocusOwnerOnHide,   coalesceEvents,   constructComponentName,   contains,   contains,   containsFocus,   countHierarchyMembers,   createBufferStrategy,   createBufferStrategy,   createHierarchyEvents,   createImage,   createImage,   createVolatileImage,   createVolatileImage,   deliverEvent,   disable,   disableEvents,   dispatchEvent,   dispatchEventImpl,   dispatchMouseWheelToAncestor,   doLayout,   enable,   enable,   enableEvents,   enableInputMethods,   eventEnabled,   eventTypeEnabled,   findUnderMouseInWindow,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   firePropertyChange,   getAccessControlContext,   getAccessibleContext,   getAccessibleIndexInParent,   getAccessibleStateSet,   getAlignmentX,   getAlignmentY,   getBackBuffer,   getBackground,   getBaseline,   getBaselineResizeBehavior,   getBounds,   getBounds,   getBoundsOp,   getBufferStrategy,   getColorModel,   getComponentAt,   getComponentAt,   getComponentListeners,   getComponentOrientation,   getContainer,   getContainingWindow,   getCursor,   getCursor_NoClientCode,   getDropTarget,   getFocusCycleRootAncestor,   getFocusListeners,   getFocusTraversalKeys,   getFocusTraversalKeysEnabled,   getFocusTraversalKeys_NoIDCheck,   getFont,   getFontMetrics,   getFont_NoClientCode,   getForeground,   getGraphics,   getGraphicsConfiguration,   getGraphicsConfiguration_NoClientCode,   getGraphics_NoClientCode,   getHWPeerAboveMe,   getHeight,   getHierarchyBoundsListeners,   getHierarchyListeners,   getIgnoreRepaint,   getInputContext,   getInputMethodListeners,   getInputMethodRequests,   getKeyListeners,   getListeners,   getLocale,   getLocation,   getLocation,   getLocationOnScreen,   getLocationOnScreen_NoTreeLock,   getLocationOnWindow,   getMaximumSize,   getMinimumSize,   getMouseListeners,   getMouseMotionListeners,   getMousePosition,   getMouseWheelListeners,   getName,   getNativeContainer,   getNextFocusCandidate,   getNormalShape,   getObjectLock,   getOpaqueShape,   getParent,   getParent_NoClientCode,   getPeer,   getPreferredSize,   getPropertyChangeListeners,   getPropertyChangeListeners,   getSiblingIndexAbove,   getSiblingIndexBelow,   getSize,   getSize,   getToolkit,   getToolkitImpl,   getTraversalRoot,   getTreeLock,   getWidth,   getX,   getY,   gotFocus,   handleEvent,   hasFocus,   hide,   imageUpdate,   initializeFocusTraversalKeys,   inside,   invalidate,   invalidateIfValid,   invalidateParent,   isAutoFocusTransferOnDisposal,   isBackgroundSet,   isCoalescingEnabled,   isCursorSet,   isDisplayable,   isDoubleBuffered,   isEnabled,   isEnabledImpl,   isFocusCycleRoot,   isFocusOwner,   isFocusTraversable,   isFocusTraversableOverridden,   isFocusable,   isFontSet,   isForegroundSet,   isInstanceOf,   isLightweight,   isMaximumSizeSet,   isMinimumSizeSet,   isMixingNeeded,   isNonOpaqueForMixing,   isOpaque,   isPreferredSizeSet,   isRecursivelyVisible,   isSameOrAncestorOf,   isShowing,   isValid,   isVisible,   isVisible_NoClientCode,   keyDown,   keyUp,   layout,   lightweightPaint,   lightweightPrint,   list,   list,   list,   list,   list,   locate,   location,   lostFocus,   minimumSize,   mixOnHiding,   mixOnReshaping,   mixOnShowing,   mixOnValidating,   mixOnZOrderChanging,   mouseDown,   mouseDrag,   mouseEnter,   mouseExit,   mouseMove,   mouseUp,   move,   nextFocus,   numListening,   paint,   paintAll,   paintHeavyweightComponents,   paramString,   pointRelativeToComponent,   postEvent,   postsOldMouseEvents,   preferredSize,   prepareImage,   prepareImage,   print,   printAll,   printHeavyweightComponents,   processComponentEvent,   processEvent,   processFocusEvent,   processHierarchyBoundsEvent,   processHierarchyEvent,   processInputMethodEvent,   processKeyEvent,   processMouseEvent,   processMouseMotionEvent,   processMouseWheelEvent,   relocateComponent,   remove,   removeComponentListener,   removeFocusListener,   removeHierarchyBoundsListener,   removeHierarchyListener,   removeInputMethodListener,   removeKeyListener,   removeMouseListener,   removeMouseMotionListener,   removeMouseWheelListener,   removeNotify,   removePropertyChangeListener,   removePropertyChangeListener,   repaint,   repaint,   repaint,   repaint,   requestFocus,   requestFocus,   requestFocus,   requestFocus,   requestFocusHelper,   requestFocusHelper,   requestFocusInWindow,   requestFocusInWindow,   requestFocusInWindow,   requestFocusInWindow,   reshape,   resize,   resize,   revalidate,   setAutoFocusTransferOnDisposal,   setBackground,   setBounds,   setBounds,   setBoundsOp,   setComponentOrientation,   setCursor,   setDropTarget,   setEnabled,   setFocusTraversalKeys,   setFocusTraversalKeysEnabled,   setFocusTraversalKeys_NoIDCheck,   setFocusable,   setFont,   setForeground,   setGraphicsConfiguration,   setIgnoreRepaint,   setLocale,   setLocation,   setLocation,   setMaximumSize,   setMinimumSize,   setName,   setPreferredSize,   setRequestFocusController,   setSize,   setSize,   setVisible,   show,   show,   size,   subtractAndApplyShape,   subtractAndApplyShapeBelowMe,   toString,   transferFocus,   transferFocus,   transferFocusBackward,   transferFocusBackward,   transferFocusUpCycle,   update,   updateCursorImmediately,   updateGraphicsData,   updateZOrder,   validate
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from javax.swing.JSlider Detail:
 public  void addChangeListener(ChangeListener l) 
    Adds a ChangeListener to the slider.
 protected ChangeListener createChangeListener() 
    Subclasses that want to handle {@code ChangeEvent}s from the model differently can override this to return an instance of a custom ChangeListener implementation. The default {@code ChangeListener} simply calls the {@code fireStateChanged} method to forward {@code ChangeEvent}s to the {@code ChangeListener}s that have been added directly to the slider.
 public Hashtable createStandardLabels(int increment) 
    Creates a {@code Hashtable} of numerical text labels, starting at the slider minimum, and using the increment specified. For example, if you call createStandardLabels( 10 ) and the slider minimum is zero, then labels will be created for the values 0, 10, 20, 30, and so on.

    For the labels to be drawn on the slider, the returned {@code Hashtable} must be passed into {@code setLabelTable}, and {@code setPaintLabels} must be set to {@code true}.

    For further details on the makeup of the returned {@code Hashtable}, see the {@code setLabelTable} documentation.

 public Hashtable createStandardLabels(int increment,
    int start) 
    Creates a {@code Hashtable} of numerical text labels, starting at the starting point specified, and using the increment specified. For example, if you call createStandardLabels( 10, 2 ), then labels will be created for the values 2, 12, 22, 32, and so on.

    For the labels to be drawn on the slider, the returned {@code Hashtable} must be passed into {@code setLabelTable}, and {@code setPaintLabels} must be set to {@code true}.

    For further details on the makeup of the returned {@code Hashtable}, see the {@code setLabelTable} documentation.

 protected  void fireStateChanged() 
    Send a {@code ChangeEvent}, whose source is this {@code JSlider}, to all {@code ChangeListener}s that have registered interest in {@code ChangeEvent}s. This method is called each time a {@code ChangeEvent} is received from the model.

    The event instance is created if necessary, and stored in {@code changeEvent}.

 public AccessibleContext getAccessibleContext() 
    Gets the AccessibleContext associated with this JSlider. For sliders, the AccessibleContext takes the form of an AccessibleJSlider. A new AccessibleJSlider instance is created if necessary.
 public ChangeListener[] getChangeListeners() 
    Returns an array of all the ChangeListeners added to this JSlider with addChangeListener().
 public int getExtent() 
    Returns the "extent" from the BoundedRangeModel. This respresents the range of values "covered" by the knob.
 public boolean getInverted() 
    Returns true if the value-range shown for the slider is reversed,
 public Dictionary getLabelTable() 
    Returns the dictionary of what labels to draw at which values.
 public int getMajorTickSpacing() 
    This method returns the major tick spacing. The number that is returned represents the distance, measured in values, between each major tick mark. If you have a slider with a range from 0 to 50 and the major tick spacing is set to 10, you will get major ticks next to the following values: 0, 10, 20, 30, 40, 50.
 public int getMaximum() 
    Returns the maximum value supported by the slider from the BoundedRangeModel.
 public int getMinimum() 
    Returns the minimum value supported by the slider from the BoundedRangeModel.
 public int getMinorTickSpacing() 
    This method returns the minor tick spacing. The number that is returned represents the distance, measured in values, between each minor tick mark. If you have a slider with a range from 0 to 50 and the minor tick spacing is set to 10, you will get minor ticks next to the following values: 0, 10, 20, 30, 40, 50.
 public BoundedRangeModel getModel() 
    Returns the {@code BoundedRangeModel} that handles the slider's three fundamental properties: minimum, maximum, value.
 public int getOrientation() 
    Return this slider's vertical or horizontal orientation.
 public boolean getPaintLabels() 
    Tells if labels are to be painted.
 public boolean getPaintTicks() 
    Tells if tick marks are to be painted.
 public boolean getPaintTrack() 
    Tells if the track (area the slider slides in) is to be painted.
 public 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.
 boolean getSnapToValue() 
    Returns true if the knob (and the data value it represents) resolve to the closest slider value next to where the user positioned the knob.
 public SliderUI getUI() 
    Gets the UI object which implements the L&F for this component.
 public String getUIClassID() 
    Returns the name of the L&F class that renders this component.
 public int getValue() 
    Returns the slider's current value from the {@code BoundedRangeModel}.
 public boolean getValueIsAdjusting() 
    Returns the {@code valueIsAdjusting} property from the model. For details on how this is used, see the {@code setValueIsAdjusting} documentation.
 public boolean imageUpdate(Image img,
    int infoflags,
    int x,
    int y,
    int w,
    int h) 
    {@inheritDoc}
 protected String paramString() 
    Returns a string representation of this JSlider. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.
 public  void removeChangeListener(ChangeListener l) 
    Removes a ChangeListener from the slider.
 public  void setExtent(int extent) 
    Sets the size of the range "covered" by the knob. Most look and feel implementations will change the value by this amount if the user clicks on either side of the knob. This method just forwards the new extent value to the model.

    The data model (an instance of {@code BoundedRangeModel}) handles any mathematical issues arising from assigning faulty values. See the {@code BoundedRangeModel} documentation for details.

    If the new extent value is different from the previous extent value, all change listeners are notified.

 public  void setFont(Font font) 
    {@inheritDoc}
 public  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. The order depends on the slider's ComponentOrientation property. Normal (non-inverted) horizontal sliders with a ComponentOrientation value of LEFT_TO_RIGHT have their maximum on the right. Normal horizontal sliders with a ComponentOrientation value of RIGHT_TO_LEFT have their maximum on the left. Normal vertical sliders have their maximum on the top. These labels are reversed when the slider is inverted.

    By default, the value of this property is {@code false}.

 public  void setLabelTable(Dictionary labels) 
    Used to specify what label will be drawn at any given value. The key-value pairs are of this format: { Integer value, java.swing.JComponent label }.

    An easy way to generate a standard table of value labels is by using the {@code createStandardLabels} method.

    Once the labels have been set, this method calls #updateLabelUIs . Note that the labels are only painted if the {@code paintLabels} property is {@code true}.

 public  void setMajorTickSpacing(int n) 
    This method sets the major tick spacing. The number that is passed in represents the distance, measured in values, between each major tick mark. If you have a slider with a range from 0 to 50 and the major tick spacing is set to 10, you will get major ticks next to the following values: 0, 10, 20, 30, 40, 50.

    In order for major ticks to be painted, {@code setPaintTicks} must be set to {@code true}.

    This method will also set up a label table for you. If there is not already a label table, and the major tick spacing is {@code > 0}, and {@code getPaintLabels} returns {@code true}, a standard label table will be generated (by calling {@code createStandardLabels}) with labels at the major tick marks. For the example above, you would get text labels: "0", "10", "20", "30", "40", "50". The label table is then set on the slider by calling {@code setLabelTable}.

 public  void setMaximum(int maximum) 
    Sets the slider's maximum value to {@code maximum}. This method forwards the new maximum value to the model.

    The data model (an instance of {@code BoundedRangeModel}) handles any mathematical issues arising from assigning faulty values. See the {@code BoundedRangeModel} documentation for details.

    If the new maximum value is different from the previous maximum value, all change listeners are notified.

 public  void setMinimum(int minimum) 
    Sets the slider's minimum value to {@code minimum}. This method forwards the new minimum value to the model.

    The data model (an instance of {@code BoundedRangeModel}) handles any mathematical issues arising from assigning faulty values. See the {@code BoundedRangeModel} documentation for details.

    If the new minimum value is different from the previous minimum value, all change listeners are notified.

 public  void setMinorTickSpacing(int n) 
    This method sets the minor tick spacing. The number that is passed in represents the distance, measured in values, between each minor tick mark. If you have a slider with a range from 0 to 50 and the minor tick spacing is set to 10, you will get minor ticks next to the following values: 0, 10, 20, 30, 40, 50.

    In order for minor ticks to be painted, {@code setPaintTicks} must be set to {@code true}.

 public  void setModel(BoundedRangeModel newModel) 
    Sets the {@code BoundedRangeModel} that handles the slider's three fundamental properties: minimum, maximum, value.

    Attempts to pass a {@code null} model to this method result in undefined behavior, and, most likely, exceptions.

 public  void setOrientation(int orientation) 
    Set the slider's orientation to either {@code SwingConstants.VERTICAL} or {@code SwingConstants.HORIZONTAL}.
 public  void setPaintLabels(boolean b) 
    Determines whether labels are painted on the slider.

    This method will also set up a label table for you. If there is not already a label table, and the major tick spacing is {@code > 0}, a standard label table will be generated (by calling {@code createStandardLabels}) with labels at the major tick marks. The label table is then set on the slider by calling {@code setLabelTable}.

    By default, this property is {@code false}.

 public  void setPaintTicks(boolean b) 
    Determines whether tick marks are painted on the slider. By default, this property is {@code false}.
 public  void setPaintTrack(boolean b) 
    Determines whether the track is painted on the slider. By default, this property is {@code true}.
 public  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. By default, this property is {@code false}.
  void setSnapToValue(boolean b) 
    Specifying true makes the knob (and the data value it represents) resolve to the closest slider value next to where the user positioned the knob. If the {@code snapToTicks} property has also been set to {@code true}, the snap-to-ticks behavior will prevail. By default, the snapToValue property is {@code true}.
 public  void setUI(SliderUI ui) 
    Sets the UI object which implements the L&F for this component.
 public  void setValue(int n) 
    Sets the slider's current value to {@code n}. This method forwards the new value to the model.

    The data model (an instance of {@code BoundedRangeModel}) handles any mathematical issues arising from assigning faulty values. See the {@code BoundedRangeModel} documentation for details.

    If the new value is different from the previous value, all change listeners are notified.

 public  void setValueIsAdjusting(boolean b) 
    Sets the model's {@code valueIsAdjusting} property. Slider look and feel implementations should set this property to {@code true} when a knob drag begins, and to {@code false} when the drag ends.
 protected  void updateLabelUIs() 
    Updates the UIs for the labels in the label table by calling {@code updateUI} on each label. The UIs are updated from the current look and feel. The labels are also set to their preferred size.
 public  void updateUI() 
    Resets the UI property to a value from the current look and feel.