java.awt
Class Scrollbar

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.awt.Component sample code for java.awt.Component definition code for java.awt.Component 
      extended by java.awt.Scrollbar
All Implemented Interfaces:
Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable , ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver , MenuContainer sample code for java.awt.MenuContainer definition code for java.awt.MenuContainer , Serializable sample code for java.io.Serializable definition code for java.io.Serializable , Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible

public class Scrollbar
extends Component sample code for java.awt.Component definition code for java.awt.Component
implements Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable , Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible

The Scrollbar class embodies a scroll bar, a familiar user-interface object. A scroll bar provides a convenient means for allowing a user to select from a range of values. The following three vertical scroll bars could be used as slider controls to pick the red, green, and blue components of a color:

Image shows 3 vertical sliders, side-by-side.

Each scroll bar in this example could be created with code similar to the following:


 redSlider=new Scrollbar(Scrollbar.VERTICAL, 0, 1, 0, 255);
 add(redSlider);
 

Alternatively, a scroll bar can represent a range of values. For example, if a scroll bar is used for scrolling through text, the width of the "bubble" (also called the "thumb" or "scroll box") can be used to represent the amount of text that is visible. Here is an example of a scroll bar that represents a range:

Image shows horizontal slider with starting range of 0 and ending range of 300. The slider thumb is labeled 60.

The value range represented by the bubble in this example is the visible amount. The horizontal scroll bar in this example could be created with code like the following:


 ranger = new Scrollbar(Scrollbar.HORIZONTAL, 0, 60, 0, 300);
 add(ranger);
 

Note that the actual maximum value of the scroll bar is the maximum minus the visible amount. In the previous example, because the maximum is 300 and the visible amount is 60, the actual maximum value is 240. The range of the scrollbar track is 0 - 300. The left side of the bubble indicates the value of the scroll bar.

Normally, the user changes the value of the scroll bar by making a gesture with the mouse. For example, the user can drag the scroll bar's bubble up and down, or click in the scroll bar's unit increment or block increment areas. Keyboard gestures can also be mapped to the scroll bar. By convention, the Page Up and Page Down keys are equivalent to clicking in the scroll bar's block increment and block decrement areas.

When the user changes the value of the scroll bar, the scroll bar receives an instance of AdjustmentEvent. The scroll bar processes this event, passing it along to any registered listeners.

Any object that wishes to be notified of changes to the scroll bar's value should implement AdjustmentListener, an interface defined in the package java.awt.event. Listeners can be added and removed dynamically by calling the methods addAdjustmentListener and removeAdjustmentListener.

The AdjustmentEvent class defines five types of adjustment event, listed here:

The JDK 1.0 event system is supported for backwards compatibility, but its use with newer versions of the platform is discouraged. The five types of adjustment events introduced with JDK 1.1 correspond to the five event types that are associated with scroll bars in previous platform versions. The following list gives the adjustment event type, and the corresponding JDK 1.0 event type it replaces.

Note: We recommend using a Scrollbar for value selection only. If you want to implement a scrollable component inside a container, we recommend you use a ScrollPane sample code for java.awt.ScrollPane definition code for java.awt.ScrollPane . If you use a Scrollbar for this purpose, you are likely to encounter issues with painting, key handling, sizing and positioning.

Since:
JDK1.0
See Also:
AdjustmentEvent sample code for java.awt.event.AdjustmentEvent definition code for java.awt.event.AdjustmentEvent , AdjustmentListener sample code for java.awt.event.AdjustmentListener definition code for java.awt.event.AdjustmentListener , Serialized Form

Nested Class Summary
protected  class Scrollbar.AccessibleAWTScrollBar sample code for java.awt.Scrollbar.AccessibleAWTScrollBar definition code for java.awt.Scrollbar.AccessibleAWTScrollBar
          This class implements accessibility support for the Scrollbar class.
 
Nested classes/interfaces inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
Component.AccessibleAWTComponent sample code for java.awt.Component.AccessibleAWTComponent definition code for java.awt.Component.AccessibleAWTComponent , Component.BltBufferStrategy sample code for java.awt.Component.BltBufferStrategy definition code for java.awt.Component.BltBufferStrategy , Component.FlipBufferStrategy sample code for java.awt.Component.FlipBufferStrategy definition code for java.awt.Component.FlipBufferStrategy
 
Field Summary
static int HORIZONTAL sample code for java.awt.Scrollbar.HORIZONTAL definition code for java.awt.Scrollbar.HORIZONTAL
          A constant that indicates a horizontal scroll bar.
static int VERTICAL sample code for java.awt.Scrollbar.VERTICAL definition code for java.awt.Scrollbar.VERTICAL
          A constant that indicates a vertical scroll bar.
 
Fields inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
BOTTOM_ALIGNMENT sample code for java.awt.Component.BOTTOM_ALIGNMENT definition code for java.awt.Component.BOTTOM_ALIGNMENT , CENTER_ALIGNMENT sample code for java.awt.Component.CENTER_ALIGNMENT definition code for java.awt.Component.CENTER_ALIGNMENT , LEFT_ALIGNMENT sample code for java.awt.Component.LEFT_ALIGNMENT definition code for java.awt.Component.LEFT_ALIGNMENT , RIGHT_ALIGNMENT sample code for java.awt.Component.RIGHT_ALIGNMENT definition code for java.awt.Component.RIGHT_ALIGNMENT , TOP_ALIGNMENT sample code for java.awt.Component.TOP_ALIGNMENT definition code for java.awt.Component.TOP_ALIGNMENT
 
Fields inherited from interface java.awt.Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable
NO_ORIENTATION sample code for java.awt.Adjustable.NO_ORIENTATION definition code for java.awt.Adjustable.NO_ORIENTATION
 
Fields inherited from interface java.awt.image.ImageObserver sample code for java.awt.image.ImageObserver definition code for java.awt.image.ImageObserver
ABORT sample code for java.awt.image.ImageObserver.ABORT definition code for java.awt.image.ImageObserver.ABORT , ALLBITS sample code for java.awt.image.ImageObserver.ALLBITS definition code for java.awt.image.ImageObserver.ALLBITS , ERROR sample code for java.awt.image.ImageObserver.ERROR definition code for java.awt.image.ImageObserver.ERROR , FRAMEBITS sample code for java.awt.image.ImageObserver.FRAMEBITS definition code for java.awt.image.ImageObserver.FRAMEBITS , HEIGHT sample code for java.awt.image.ImageObserver.HEIGHT definition code for java.awt.image.ImageObserver.HEIGHT , PROPERTIES sample code for java.awt.image.ImageObserver.PROPERTIES definition code for java.awt.image.ImageObserver.PROPERTIES , SOMEBITS sample code for java.awt.image.ImageObserver.SOMEBITS definition code for java.awt.image.ImageObserver.SOMEBITS , WIDTH sample code for java.awt.image.ImageObserver.WIDTH definition code for java.awt.image.ImageObserver.WIDTH
 
Constructor Summary
Scrollbar sample code for java.awt.Scrollbar.Scrollbar() definition code for java.awt.Scrollbar.Scrollbar() ()
          Constructs a new vertical scroll bar.
Scrollbar sample code for java.awt.Scrollbar.Scrollbar(int) definition code for java.awt.Scrollbar.Scrollbar(int) (int orientation)
          Constructs a new scroll bar with the specified orientation.
Scrollbar sample code for java.awt.Scrollbar.Scrollbar(int, int, int, int, int) definition code for java.awt.Scrollbar.Scrollbar(int, int, int, int, int) (int orientation, int value, int visible, int minimum, int maximum)
          Constructs a new scroll bar with the specified orientation, initial value, visible amount, and minimum and maximum values.
 
Method Summary
 void addAdjustmentListener sample code for java.awt.Scrollbar.addAdjustmentListener(java.awt.event.AdjustmentListener) definition code for java.awt.Scrollbar.addAdjustmentListener(java.awt.event.AdjustmentListener) (AdjustmentListener sample code for java.awt.event.AdjustmentListener definition code for java.awt.event.AdjustmentListener  l)
          Adds the specified adjustment listener to receive instances of AdjustmentEvent from this scroll bar.
 void addNotify sample code for java.awt.Scrollbar.addNotify() definition code for java.awt.Scrollbar.addNotify() ()
          Creates the Scrollbar's peer.
 AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext getAccessibleContext sample code for java.awt.Scrollbar.getAccessibleContext() definition code for java.awt.Scrollbar.getAccessibleContext() ()
          Gets the AccessibleContext associated with this Scrollbar.
 AdjustmentListener sample code for java.awt.event.AdjustmentListener definition code for java.awt.event.AdjustmentListener [] getAdjustmentListeners sample code for java.awt.Scrollbar.getAdjustmentListeners() definition code for java.awt.Scrollbar.getAdjustmentListeners() ()
          Returns an array of all the adjustment listeners registered on this scrollbar.
 int getBlockIncrement sample code for java.awt.Scrollbar.getBlockIncrement() definition code for java.awt.Scrollbar.getBlockIncrement() ()
          Gets the block increment of this scroll bar.
 int getLineIncrement sample code for java.awt.Scrollbar.getLineIncrement() definition code for java.awt.Scrollbar.getLineIncrement() ()
          Deprecated. As of JDK version 1.1, replaced by getUnitIncrement().
<T extends EventListener sample code for java.util.EventListener definition code for java.util.EventListener >
T[]
getListeners sample code for java.awt.Scrollbar.getListeners(java.lang.Class) definition code for java.awt.Scrollbar.getListeners(java.lang.Class) (Class sample code for java.lang.Class definition code for java.lang.Class <T> listenerType)
          Returns an array of all the objects currently registered as FooListeners upon this Scrollbar.
 int getMaximum sample code for java.awt.Scrollbar.getMaximum() definition code for java.awt.Scrollbar.getMaximum() ()
          Gets the maximum value of this scroll bar.
 int getMinimum sample code for java.awt.Scrollbar.getMinimum() definition code for java.awt.Scrollbar.getMinimum() ()
          Gets the minimum value of this scroll bar.
 int getOrientation sample code for java.awt.Scrollbar.getOrientation() definition code for java.awt.Scrollbar.getOrientation() ()
          Returns the orientation of this scroll bar.
 int getPageIncrement sample code for java.awt.Scrollbar.getPageIncrement() definition code for java.awt.Scrollbar.getPageIncrement() ()
          Deprecated. As of JDK version 1.1, replaced by getBlockIncrement().
 int getUnitIncrement sample code for java.awt.Scrollbar.getUnitIncrement() definition code for java.awt.Scrollbar.getUnitIncrement() ()
          Gets the unit increment for this scrollbar.
 int getValue sample code for java.awt.Scrollbar.getValue() definition code for java.awt.Scrollbar.getValue() ()
          Gets the current value of this scroll bar.
 boolean getValueIsAdjusting sample code for java.awt.Scrollbar.getValueIsAdjusting() definition code for java.awt.Scrollbar.getValueIsAdjusting() ()
          Returns true if the value is in the process of changing as a result of actions being taken by the user.
 int getVisible sample code for java.awt.Scrollbar.getVisible() definition code for java.awt.Scrollbar.getVisible() ()
          Deprecated. As of JDK version 1.1, replaced by getVisibleAmount().
 int getVisibleAmount sample code for java.awt.Scrollbar.getVisibleAmount() definition code for java.awt.Scrollbar.getVisibleAmount() ()
          Gets the visible amount of this scroll bar.
protected  String sample code for java.lang.String definition code for java.lang.String paramString sample code for java.awt.Scrollbar.paramString() definition code for java.awt.Scrollbar.paramString() ()
          Returns a string representing the state of this Scrollbar.
protected  void processAdjustmentEvent sample code for java.awt.Scrollbar.processAdjustmentEvent(java.awt.event.AdjustmentEvent) definition code for java.awt.Scrollbar.processAdjustmentEvent(java.awt.event.AdjustmentEvent) (AdjustmentEvent sample code for java.awt.event.AdjustmentEvent definition code for java.awt.event.AdjustmentEvent  e)
          Processes adjustment events occurring on this scrollbar by dispatching them to any registered AdjustmentListener objects.
protected  void processEvent sample code for java.awt.Scrollbar.processEvent(java.awt.AWTEvent) definition code for java.awt.Scrollbar.processEvent(java.awt.AWTEvent) (AWTEvent sample code for java.awt.AWTEvent definition code for java.awt.AWTEvent  e)
          Processes events on this scroll bar.
 void removeAdjustmentListener sample code for java.awt.Scrollbar.removeAdjustmentListener(java.awt.event.AdjustmentListener) definition code for java.awt.Scrollbar.removeAdjustmentListener(java.awt.event.AdjustmentListener) (AdjustmentListener sample code for java.awt.event.AdjustmentListener definition code for java.awt.event.AdjustmentListener  l)
          Removes the specified adjustment listener so that it no longer receives instances of AdjustmentEvent from this scroll bar.
 void setBlockIncrement sample code for java.awt.Scrollbar.setBlockIncrement(int) definition code for java.awt.Scrollbar.setBlockIncrement(int) (int v)
          Sets the block increment for this scroll bar.
 void setLineIncrement sample code for java.awt.Scrollbar.setLineIncrement(int) definition code for java.awt.Scrollbar.setLineIncrement(int) (int v)
          Deprecated. As of JDK version 1.1, replaced by setUnitIncrement(int).
 void setMaximum sample code for java.awt.Scrollbar.setMaximum(int) definition code for java.awt.Scrollbar.setMaximum(int) (int newMaximum)
          Sets the maximum value of this scroll bar.
 void setMinimum sample code for java.awt.Scrollbar.setMinimum(int) definition code for java.awt.Scrollbar.setMinimum(int) (int newMinimum)
          Sets the minimum value of this scroll bar.
 void setOrientation sample code for java.awt.Scrollbar.setOrientation(int) definition code for java.awt.Scrollbar.setOrientation(int) (int orientation)
          Sets the orientation for this scroll bar.
 void setPageIncrement sample code for java.awt.Scrollbar.setPageIncrement(int) definition code for java.awt.Scrollbar.setPageIncrement(int) (int v)
          Deprecated. As of JDK version 1.1, replaced by setBlockIncrement().
 void setUnitIncrement sample code for java.awt.Scrollbar.setUnitIncrement(int) definition code for java.awt.Scrollbar.setUnitIncrement(int) (int v)
          Sets the unit increment for this scroll bar.
 void setValue sample code for java.awt.Scrollbar.setValue(int) definition code for java.awt.Scrollbar.setValue(int) (int newValue)
          Sets the value of this scroll bar to the specified value.
 void setValueIsAdjusting sample code for java.awt.Scrollbar.setValueIsAdjusting(boolean) definition code for java.awt.Scrollbar.setValueIsAdjusting(boolean) (boolean b)
          Sets the valueIsAdjusting property.
 void setValues sample code for java.awt.Scrollbar.setValues(int, int, int, int) definition code for java.awt.Scrollbar.setValues(int, int, int, int) (int value, int visible, int minimum, int maximum)
          Sets the values of four properties for this scroll bar: value, visibleAmount, minimum, and maximum.
 void setVisibleAmount sample code for java.awt.Scrollbar.setVisibleAmount(int) definition code for java.awt.Scrollbar.setVisibleAmount(int) (int newAmount)
          Sets the visible amount of this scroll bar.
 
Methods inherited from class java.awt.Component sample code for java.awt.Component definition code for java.awt.Component
action sample code for java.awt.Component.action(java.awt.Event, java.lang.Object) definition code for java.awt.Component.action(java.awt.Event, java.lang.Object) , add sample code for java.awt.Component.add(java.awt.PopupMenu) definition code for java.awt.Component.add(java.awt.PopupMenu) , addComponentListener sample code for java.awt.Component.addComponentListener(java.awt.event.ComponentListener) definition code for java.awt.Component.addComponentListener(java.awt.event.ComponentListener) , addFocusListener sample code for java.awt.Component.addFocusListener(java.awt.event.FocusListener) definition code for java.awt.Component.addFocusListener(java.awt.event.FocusListener) , addHierarchyBoundsListener sample code for java.awt.Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) definition code for java.awt.Component.addHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) , addHierarchyListener sample code for java.awt.Component.addHierarchyListener(java.awt.event.HierarchyListener) definition code for java.awt.Component.addHierarchyListener(java.awt.event.HierarchyListener) , addInputMethodListener sample code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener) definition code for java.awt.Component.addInputMethodListener(java.awt.event.InputMethodListener) , addKeyListener sample code for java.awt.Component.addKeyListener(java.awt.event.KeyListener) definition code for java.awt.Component.addKeyListener(java.awt.event.KeyListener) , addMouseListener sample code for java.awt.Component.addMouseListener(java.awt.event.MouseListener) definition code for java.awt.Component.addMouseListener(java.awt.event.MouseListener) , addMouseMotionListener sample code for java.awt.Component.addMouseMotionListener(java.awt.event.MouseMotionListener) definition code for java.awt.Component.addMouseMotionListener(java.awt.event.MouseMotionListener) , addMouseWheelListener sample code for java.awt.Component.addMouseWheelListener(java.awt.event.MouseWheelListener) definition code for java.awt.Component.addMouseWheelListener(java.awt.event.MouseWheelListener) , addPropertyChangeListener sample code for java.awt.Component.addPropertyChangeListener(java.beans.PropertyChangeListener) definition code for java.awt.Component.addPropertyChangeListener(java.beans.PropertyChangeListener) , addPropertyChangeListener sample code for java.awt.Component.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.awt.Component.addPropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) , applyComponentOrientation sample code for java.awt.Component.applyComponentOrientation(java.awt.ComponentOrientation) definition code for java.awt.Component.applyComponentOrientation(java.awt.ComponentOrientation) , areFocusTraversalKeysSet sample code for java.awt.Component.areFocusTraversalKeysSet(int) definition code for java.awt.Component.areFocusTraversalKeysSet(int) , bounds sample code for java.awt.Component.bounds() definition code for java.awt.Component.bounds() , checkImage sample code for java.awt.Component.checkImage(java.awt.Image, java.awt.image.ImageObserver) definition code for java.awt.Component.checkImage(java.awt.Image, java.awt.image.ImageObserver) , checkImage sample code for java.awt.Component.checkImage(java.awt.Image, int, int, java.awt.image.ImageObserver) definition code for java.awt.Component.checkImage(java.awt.Image, int, int, java.awt.image.ImageObserver) , coalesceEvents sample code for java.awt.Component.coalesceEvents(java.awt.AWTEvent, java.awt.AWTEvent) definition code for java.awt.Component.coalesceEvents(java.awt.AWTEvent, java.awt.AWTEvent) , contains sample code for java.awt.Component.contains(int, int) definition code for java.awt.Component.contains(int, int) , contains sample code for java.awt.Component.contains(java.awt.Point) definition code for java.awt.Component.contains(java.awt.Point) , createImage sample code for java.awt.Component.createImage(java.awt.image.ImageProducer) definition code for java.awt.Component.createImage(java.awt.image.ImageProducer) , createImage sample code for java.awt.Component.createImage(int, int) definition code for java.awt.Component.createImage(int, int) , createVolatileImage sample code for java.awt.Component.createVolatileImage(int, int) definition code for java.awt.Component.createVolatileImage(int, int) , createVolatileImage sample code for java.awt.Component.createVolatileImage(int, int, java.awt.ImageCapabilities) definition code for java.awt.Component.createVolatileImage(int, int, java.awt.ImageCapabilities) , deliverEvent sample code for java.awt.Component.deliverEvent(java.awt.Event) definition code for java.awt.Component.deliverEvent(java.awt.Event) , disable sample code for java.awt.Component.disable() definition code for java.awt.Component.disable() , disableEvents sample code for java.awt.Component.disableEvents(long) definition code for java.awt.Component.disableEvents(long) , dispatchEvent sample code for java.awt.Component.dispatchEvent(java.awt.AWTEvent) definition code for java.awt.Component.dispatchEvent(java.awt.AWTEvent) , doLayout sample code for java.awt.Component.doLayout() definition code for java.awt.Component.doLayout() , enable sample code for java.awt.Component.enable() definition code for java.awt.Component.enable() , enable sample code for java.awt.Component.enable(boolean) definition code for java.awt.Component.enable(boolean) , enableEvents sample code for java.awt.Component.enableEvents(long) definition code for java.awt.Component.enableEvents(long) , enableInputMethods sample code for java.awt.Component.enableInputMethods(boolean) definition code for java.awt.Component.enableInputMethods(boolean) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, boolean, boolean) definition code for java.awt.Component.firePropertyChange(java.lang.String, boolean, boolean) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, byte, byte) definition code for java.awt.Component.firePropertyChange(java.lang.String, byte, byte) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, char, char) definition code for java.awt.Component.firePropertyChange(java.lang.String, char, char) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, double, double) definition code for java.awt.Component.firePropertyChange(java.lang.String, double, double) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, float, float) definition code for java.awt.Component.firePropertyChange(java.lang.String, float, float) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, int, int) definition code for java.awt.Component.firePropertyChange(java.lang.String, int, int) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, long, long) definition code for java.awt.Component.firePropertyChange(java.lang.String, long, long) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) definition code for java.awt.Component.firePropertyChange(java.lang.String, java.lang.Object, java.lang.Object) , firePropertyChange sample code for java.awt.Component.firePropertyChange(java.lang.String, short, short) definition code for java.awt.Component.firePropertyChange(java.lang.String, short, short) , getAlignmentX sample code for java.awt.Component.getAlignmentX() definition code for java.awt.Component.getAlignmentX() , getAlignmentY sample code for java.awt.Component.getAlignmentY() definition code for java.awt.Component.getAlignmentY() , getBackground sample code for java.awt.Component.getBackground() definition code for java.awt.Component.getBackground() , getBounds sample code for java.awt.Component.getBounds() definition code for java.awt.Component.getBounds() , getBounds sample code for java.awt.Component.getBounds(java.awt.Rectangle) definition code for java.awt.Component.getBounds(java.awt.Rectangle) , getColorModel sample code for java.awt.Component.getColorModel() definition code for java.awt.Component.getColorModel() , getComponentAt sample code for java.awt.Component.getComponentAt(int, int) definition code for java.awt.Component.getComponentAt(int, int) , getComponentAt sample code for java.awt.Component.getComponentAt(java.awt.Point) definition code for java.awt.Component.getComponentAt(java.awt.Point) , getComponentListeners sample code for java.awt.Component.getComponentListeners() definition code for java.awt.Component.getComponentListeners() , getComponentOrientation sample code for java.awt.Component.getComponentOrientation() definition code for java.awt.Component.getComponentOrientation() , getCursor sample code for java.awt.Component.getCursor() definition code for java.awt.Component.getCursor() , getDropTarget sample code for java.awt.Component.getDropTarget() definition code for java.awt.Component.getDropTarget() , getFocusCycleRootAncestor sample code for java.awt.Component.getFocusCycleRootAncestor() definition code for java.awt.Component.getFocusCycleRootAncestor() , getFocusListeners sample code for java.awt.Component.getFocusListeners() definition code for java.awt.Component.getFocusListeners() , getFocusTraversalKeys sample code for java.awt.Component.getFocusTraversalKeys(int) definition code for java.awt.Component.getFocusTraversalKeys(int) , getFocusTraversalKeysEnabled sample code for java.awt.Component.getFocusTraversalKeysEnabled() definition code for java.awt.Component.getFocusTraversalKeysEnabled() , getFont sample code for java.awt.Component.getFont() definition code for java.awt.Component.getFont() , getFontMetrics sample code for java.awt.Component.getFontMetrics(java.awt.Font) definition code for java.awt.Component.getFontMetrics(java.awt.Font) , getForeground sample code for java.awt.Component.getForeground() definition code for java.awt.Component.getForeground() , getGraphics sample code for java.awt.Component.getGraphics() definition code for java.awt.Component.getGraphics() , getGraphicsConfiguration sample code for java.awt.Component.getGraphicsConfiguration() definition code for java.awt.Component.getGraphicsConfiguration() , getHeight sample code for java.awt.Component.getHeight() definition code for java.awt.Component.getHeight() , getHierarchyBoundsListeners sample code for java.awt.Component.getHierarchyBoundsListeners() definition code for java.awt.Component.getHierarchyBoundsListeners() , getHierarchyListeners sample code for java.awt.Component.getHierarchyListeners() definition code for java.awt.Component.getHierarchyListeners() , getIgnoreRepaint sample code for java.awt.Component.getIgnoreRepaint() definition code for java.awt.Component.getIgnoreRepaint() , getInputContext sample code for java.awt.Component.getInputContext() definition code for java.awt.Component.getInputContext() , getInputMethodListeners sample code for java.awt.Component.getInputMethodListeners() definition code for java.awt.Component.getInputMethodListeners() , getInputMethodRequests sample code for java.awt.Component.getInputMethodRequests() definition code for java.awt.Component.getInputMethodRequests() , getKeyListeners sample code for java.awt.Component.getKeyListeners() definition code for java.awt.Component.getKeyListeners() , getLocale sample code for java.awt.Component.getLocale() definition code for java.awt.Component.getLocale() , getLocation sample code for java.awt.Component.getLocation() definition code for java.awt.Component.getLocation() , getLocation sample code for java.awt.Component.getLocation(java.awt.Point) definition code for java.awt.Component.getLocation(java.awt.Point) , getLocationOnScreen sample code for java.awt.Component.getLocationOnScreen() definition code for java.awt.Component.getLocationOnScreen() , getMaximumSize sample code for java.awt.Component.getMaximumSize() definition code for java.awt.Component.getMaximumSize() , getMinimumSize sample code for java.awt.Component.getMinimumSize() definition code for java.awt.Component.getMinimumSize() , getMouseListeners sample code for java.awt.Component.getMouseListeners() definition code for java.awt.Component.getMouseListeners() , getMouseMotionListeners sample code for java.awt.Component.getMouseMotionListeners() definition code for java.awt.Component.getMouseMotionListeners() , getMousePosition sample code for java.awt.Component.getMousePosition() definition code for java.awt.Component.getMousePosition() , getMouseWheelListeners sample code for java.awt.Component.getMouseWheelListeners() definition code for java.awt.Component.getMouseWheelListeners() , getName sample code for java.awt.Component.getName() definition code for java.awt.Component.getName() , getParent sample code for java.awt.Component.getParent() definition code for java.awt.Component.getParent() , getPeer sample code for java.awt.Component.getPeer() definition code for java.awt.Component.getPeer() , getPreferredSize sample code for java.awt.Component.getPreferredSize() definition code for java.awt.Component.getPreferredSize() , getPropertyChangeListeners sample code for java.awt.Component.getPropertyChangeListeners() definition code for java.awt.Component.getPropertyChangeListeners() , getPropertyChangeListeners sample code for java.awt.Component.getPropertyChangeListeners(java.lang.String) definition code for java.awt.Component.getPropertyChangeListeners(java.lang.String) , getSize sample code for java.awt.Component.getSize() definition code for java.awt.Component.getSize() , getSize sample code for java.awt.Component.getSize(java.awt.Dimension) definition code for java.awt.Component.getSize(java.awt.Dimension) , getToolkit sample code for java.awt.Component.getToolkit() definition code for java.awt.Component.getToolkit() , getTreeLock sample code for java.awt.Component.getTreeLock() definition code for java.awt.Component.getTreeLock() , getWidth sample code for java.awt.Component.getWidth() definition code for java.awt.Component.getWidth() , getX sample code for java.awt.Component.getX() definition code for java.awt.Component.getX() , getY sample code for java.awt.Component.getY() definition code for java.awt.Component.getY() , gotFocus sample code for java.awt.Component.gotFocus(java.awt.Event, java.lang.Object) definition code for java.awt.Component.gotFocus(java.awt.Event, java.lang.Object) , handleEvent sample code for java.awt.Component.handleEvent(java.awt.Event) definition code for java.awt.Component.handleEvent(java.awt.Event) , hasFocus sample code for java.awt.Component.hasFocus() definition code for java.awt.Component.hasFocus() , hide sample code for java.awt.Component.hide() definition code for java.awt.Component.hide() , imageUpdate sample code for java.awt.Component.imageUpdate(java.awt.Image, int, int, int, int, int) definition code for java.awt.Component.imageUpdate(java.awt.Image, int, int, int, int, int) , inside sample code for java.awt.Component.inside(int, int) definition code for java.awt.Component.inside(int, int) , invalidate sample code for java.awt.Component.invalidate() definition code for java.awt.Component.invalidate() , isBackgroundSet sample code for java.awt.Component.isBackgroundSet() definition code for java.awt.Component.isBackgroundSet() , isCursorSet sample code for java.awt.Component.isCursorSet() definition code for java.awt.Component.isCursorSet() , isDisplayable sample code for java.awt.Component.isDisplayable() definition code for java.awt.Component.isDisplayable() , isDoubleBuffered sample code for java.awt.Component.isDoubleBuffered() definition code for java.awt.Component.isDoubleBuffered() , isEnabled sample code for java.awt.Component.isEnabled() definition code for java.awt.Component.isEnabled() , isFocusable sample code for java.awt.Component.isFocusable() definition code for java.awt.Component.isFocusable() , isFocusCycleRoot sample code for java.awt.Component.isFocusCycleRoot(java.awt.Container) definition code for java.awt.Component.isFocusCycleRoot(java.awt.Container) , isFocusOwner sample code for java.awt.Component.isFocusOwner() definition code for java.awt.Component.isFocusOwner() , isFocusTraversable sample code for java.awt.Component.isFocusTraversable() definition code for java.awt.Component.isFocusTraversable() , isFontSet sample code for java.awt.Component.isFontSet() definition code for java.awt.Component.isFontSet() , isForegroundSet sample code for java.awt.Component.isForegroundSet() definition code for java.awt.Component.isForegroundSet() , isLightweight sample code for java.awt.Component.isLightweight() definition code for java.awt.Component.isLightweight() , isMaximumSizeSet sample code for java.awt.Component.isMaximumSizeSet() definition code for java.awt.Component.isMaximumSizeSet() , isMinimumSizeSet sample code for java.awt.Component.isMinimumSizeSet() definition code for java.awt.Component.isMinimumSizeSet() , isOpaque sample code for java.awt.Component.isOpaque() definition code for java.awt.Component.isOpaque() , isPreferredSizeSet sample code for java.awt.Component.isPreferredSizeSet() definition code for java.awt.Component.isPreferredSizeSet() , isShowing sample code for java.awt.Component.isShowing() definition code for java.awt.Component.isShowing() , isValid sample code for java.awt.Component.isValid() definition code for java.awt.Component.isValid() , isVisible sample code for java.awt.Component.isVisible() definition code for java.awt.Component.isVisible() , keyDown sample code for java.awt.Component.keyDown(java.awt.Event, int) definition code for java.awt.Component.keyDown(java.awt.Event, int) , keyUp sample code for java.awt.Component.keyUp(java.awt.Event, int) definition code for java.awt.Component.keyUp(java.awt.Event, int) , layout sample code for java.awt.Component.layout() definition code for java.awt.Component.layout() , list sample code for java.awt.Component.list() definition code for java.awt.Component.list() , list sample code for java.awt.Component.list(java.io.PrintStream) definition code for java.awt.Component.list(java.io.PrintStream) , list sample code for java.awt.Component.list(java.io.PrintStream, int) definition code for java.awt.Component.list(java.io.PrintStream, int) , list sample code for java.awt.Component.list(java.io.PrintWriter) definition code for java.awt.Component.list(java.io.PrintWriter) , list sample code for java.awt.Component.list(java.io.PrintWriter, int) definition code for java.awt.Component.list(java.io.PrintWriter, int) , locate sample code for java.awt.Component.locate(int, int) definition code for java.awt.Component.locate(int, int) , location sample code for java.awt.Component.location() definition code for java.awt.Component.location() , lostFocus sample code for java.awt.Component.lostFocus(java.awt.Event, java.lang.Object) definition code for java.awt.Component.lostFocus(java.awt.Event, java.lang.Object) , minimumSize sample code for java.awt.Component.minimumSize() definition code for java.awt.Component.minimumSize() , mouseDown sample code for java.awt.Component.mouseDown(java.awt.Event, int, int) definition code for java.awt.Component.mouseDown(java.awt.Event, int, int) , mouseDrag sample code for java.awt.Component.mouseDrag(java.awt.Event, int, int) definition code for java.awt.Component.mouseDrag(java.awt.Event, int, int) , mouseEnter sample code for java.awt.Component.mouseEnter(java.awt.Event, int, int) definition code for java.awt.Component.mouseEnter(java.awt.Event, int, int) , mouseExit sample code for java.awt.Component.mouseExit(java.awt.Event, int, int) definition code for java.awt.Component.mouseExit(java.awt.Event, int, int) , mouseMove sample code for java.awt.Component.mouseMove(java.awt.Event, int, int) definition code for java.awt.Component.mouseMove(java.awt.Event, int, int) , mouseUp sample code for java.awt.Component.mouseUp(java.awt.Event, int, int) definition code for java.awt.Component.mouseUp(java.awt.Event, int, int) , move sample code for java.awt.Component.move(int, int) definition code for java.awt.Component.move(int, int) , nextFocus sample code for java.awt.Component.nextFocus() definition code for java.awt.Component.nextFocus() , paint sample code for java.awt.Component.paint(java.awt.Graphics) definition code for java.awt.Component.paint(java.awt.Graphics) , paintAll sample code for java.awt.Component.paintAll(java.awt.Graphics) definition code for java.awt.Component.paintAll(java.awt.Graphics) , postEvent sample code for java.awt.Component.postEvent(java.awt.Event) definition code for java.awt.Component.postEvent(java.awt.Event) , preferredSize sample code for java.awt.Component.preferredSize() definition code for java.awt.Component.preferredSize() , prepareImage sample code for java.awt.Component.prepareImage(java.awt.Image, java.awt.image.ImageObserver) definition code for java.awt.Component.prepareImage(java.awt.Image, java.awt.image.ImageObserver) , prepareImage sample code for java.awt.Component.prepareImage(java.awt.Image, int, int, java.awt.image.ImageObserver) definition code for java.awt.Component.prepareImage(java.awt.Image, int, int, java.awt.image.ImageObserver) , print sample code for java.awt.Component.print(java.awt.Graphics) definition code for java.awt.Component.print(java.awt.Graphics) , printAll sample code for java.awt.Component.printAll(java.awt.Graphics) definition code for java.awt.Component.printAll(java.awt.Graphics) , processComponentEvent sample code for java.awt.Component.processComponentEvent(java.awt.event.ComponentEvent) definition code for java.awt.Component.processComponentEvent(java.awt.event.ComponentEvent) , processFocusEvent sample code for java.awt.Component.processFocusEvent(java.awt.event.FocusEvent) definition code for java.awt.Component.processFocusEvent(java.awt.event.FocusEvent) , processHierarchyBoundsEvent sample code for java.awt.Component.processHierarchyBoundsEvent(java.awt.event.HierarchyEvent) definition code for java.awt.Component.processHierarchyBoundsEvent(java.awt.event.HierarchyEvent) , processHierarchyEvent sample code for java.awt.Component.processHierarchyEvent(java.awt.event.HierarchyEvent) definition code for java.awt.Component.processHierarchyEvent(java.awt.event.HierarchyEvent) , processInputMethodEvent sample code for java.awt.Component.processInputMethodEvent(java.awt.event.InputMethodEvent) definition code for java.awt.Component.processInputMethodEvent(java.awt.event.InputMethodEvent) , processKeyEvent sample code for java.awt.Component.processKeyEvent(java.awt.event.KeyEvent) definition code for java.awt.Component.processKeyEvent(java.awt.event.KeyEvent) , processMouseEvent sample code for java.awt.Component.processMouseEvent(java.awt.event.MouseEvent) definition code for java.awt.Component.processMouseEvent(java.awt.event.MouseEvent) , processMouseMotionEvent sample code for java.awt.Component.processMouseMotionEvent(java.awt.event.MouseEvent) definition code for java.awt.Component.processMouseMotionEvent(java.awt.event.MouseEvent) , processMouseWheelEvent sample code for java.awt.Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent) definition code for java.awt.Component.processMouseWheelEvent(java.awt.event.MouseWheelEvent) , remove sample code for java.awt.Component.remove(java.awt.MenuComponent) definition code for java.awt.Component.remove(java.awt.MenuComponent) , removeComponentListener sample code for java.awt.Component.removeComponentListener(java.awt.event.ComponentListener) definition code for java.awt.Component.removeComponentListener(java.awt.event.ComponentListener) , removeFocusListener sample code for java.awt.Component.removeFocusListener(java.awt.event.FocusListener) definition code for java.awt.Component.removeFocusListener(java.awt.event.FocusListener) , removeHierarchyBoundsListener sample code for java.awt.Component.removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) definition code for java.awt.Component.removeHierarchyBoundsListener(java.awt.event.HierarchyBoundsListener) , removeHierarchyListener sample code for java.awt.Component.removeHierarchyListener(java.awt.event.HierarchyListener) definition code for java.awt.Component.removeHierarchyListener(java.awt.event.HierarchyListener) , removeInputMethodListener sample code for java.awt.Component.removeInputMethodListener(java.awt.event.InputMethodListener) definition code for java.awt.Component.removeInputMethodListener(java.awt.event.InputMethodListener) , removeKeyListener sample code for java.awt.Component.removeKeyListener(java.awt.event.KeyListener) definition code for java.awt.Component.removeKeyListener(java.awt.event.KeyListener) , removeMouseListener sample code for java.awt.Component.removeMouseListener(java.awt.event.MouseListener) definition code for java.awt.Component.removeMouseListener(java.awt.event.MouseListener) , removeMouseMotionListener sample code for java.awt.Component.removeMouseMotionListener(java.awt.event.MouseMotionListener) definition code for java.awt.Component.removeMouseMotionListener(java.awt.event.MouseMotionListener) , removeMouseWheelListener sample code for java.awt.Component.removeMouseWheelListener(java.awt.event.MouseWheelListener) definition code for java.awt.Component.removeMouseWheelListener(java.awt.event.MouseWheelListener) , removeNotify sample code for java.awt.Component.removeNotify() definition code for java.awt.Component.removeNotify() , removePropertyChangeListener sample code for java.awt.Component.removePropertyChangeListener(java.beans.PropertyChangeListener) definition code for java.awt.Component.removePropertyChangeListener(java.beans.PropertyChangeListener) , removePropertyChangeListener sample code for java.awt.Component.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) definition code for java.awt.Component.removePropertyChangeListener(java.lang.String, java.beans.PropertyChangeListener) , repaint sample code for java.awt.Component.repaint() definition code for java.awt.Component.repaint() , repaint sample code for java.awt.Component.repaint(int, int, int, int) definition code for java.awt.Component.repaint(int, int, int, int) , repaint sample code for java.awt.Component.repaint(long) definition code for java.awt.Component.repaint(long) , repaint sample code for java.awt.Component.repaint(long, int, int, int, int) definition code for java.awt.Component.repaint(long, int, int, int, int) , requestFocus sample code for java.awt.Component.requestFocus() definition code for java.awt.Component.requestFocus() , requestFocus sample code for java.awt.Component.requestFocus(boolean) definition code for java.awt.Component.requestFocus(boolean) , requestFocusInWindow sample code for java.awt.Component.requestFocusInWindow() definition code for java.awt.Component.requestFocusInWindow() , requestFocusInWindow sample code for java.awt.Component.requestFocusInWindow(boolean) definition code for java.awt.Component.requestFocusInWindow(boolean) , reshape sample code for java.awt.Component.reshape(int, int, int, int) definition code for java.awt.Component.reshape(int, int, int, int) , resize sample code for java.awt.Component.resize(java.awt.Dimension) definition code for java.awt.Component.resize(java.awt.Dimension) , resize sample code for java.awt.Component.resize(int, int) definition code for java.awt.Component.resize(int, int) , setBackground sample code for java.awt.Component.setBackground(java.awt.Color) definition code for java.awt.Component.setBackground(java.awt.Color) , setBounds sample code for java.awt.Component.setBounds(int, int, int, int) definition code for java.awt.Component.setBounds(int, int, int, int) , setBounds sample code for java.awt.Component.setBounds(java.awt.Rectangle) definition code for java.awt.Component.setBounds(java.awt.Rectangle) , setComponentOrientation sample code for java.awt.Component.setComponentOrientation(java.awt.ComponentOrientation) definition code for java.awt.Component.setComponentOrientation(java.awt.ComponentOrientation) , setCursor sample code for java.awt.Component.setCursor(java.awt.Cursor) definition code for java.awt.Component.setCursor(java.awt.Cursor) , setDropTarget sample code for java.awt.Component.setDropTarget(java.awt.dnd.DropTarget) definition code for java.awt.Component.setDropTarget(java.awt.dnd.DropTarget) , setEnabled sample code for java.awt.Component.setEnabled(boolean) definition code for java.awt.Component.setEnabled(boolean) , setFocusable sample code for java.awt.Component.setFocusable(boolean) definition code for java.awt.Component.setFocusable(boolean) , setFocusTraversalKeys sample code for java.awt.Component.setFocusTraversalKeys(int, java.util.Set) definition code for java.awt.Component.setFocusTraversalKeys(int, java.util.Set) , setFocusTraversalKeysEnabled sample code for java.awt.Component.setFocusTraversalKeysEnabled(boolean) definition code for java.awt.Component.setFocusTraversalKeysEnabled(boolean) , setFont sample code for java.awt.Component.setFont(java.awt.Font) definition code for java.awt.Component.setFont(java.awt.Font) , setForeground sample code for java.awt.Component.setForeground(java.awt.Color) definition code for java.awt.Component.setForeground(java.awt.Color) , setIgnoreRepaint sample code for java.awt.Component.setIgnoreRepaint(boolean) definition code for java.awt.Component.setIgnoreRepaint(boolean) , setLocale sample code for java.awt.Component.setLocale(java.util.Locale) definition code for java.awt.Component.setLocale(java.util.Locale) , setLocation sample code for java.awt.Component.setLocation(int, int) definition code for java.awt.Component.setLocation(int, int) , setLocation sample code for java.awt.Component.setLocation(java.awt.Point) definition code for java.awt.Component.setLocation(java.awt.Point) , setMaximumSize sample code for java.awt.Component.setMaximumSize(java.awt.Dimension) definition code for java.awt.Component.setMaximumSize(java.awt.Dimension) , setMinimumSize sample code for java.awt.Component.setMinimumSize(java.awt.Dimension) definition code for java.awt.Component.setMinimumSize(java.awt.Dimension) , setName sample code for java.awt.Component.setName(java.lang.String) definition code for java.awt.Component.setName(java.lang.String) , setPreferredSize sample code for java.awt.Component.setPreferredSize(java.awt.Dimension) definition code for java.awt.Component.setPreferredSize(java.awt.Dimension) , setSize sample code for java.awt.Component.setSize(java.awt.Dimension) definition code for java.awt.Component.setSize(java.awt.Dimension) , setSize sample code for java.awt.Component.setSize(int, int) definition code for java.awt.Component.setSize(int, int) , setVisible sample code for java.awt.Component.setVisible(boolean) definition code for java.awt.Component.setVisible(boolean) , show sample code for java.awt.Component.show() definition code for java.awt.Component.show() , show sample code for java.awt.Component.show(boolean) definition code for java.awt.Component.show(boolean) , size sample code for java.awt.Component.size() definition code for java.awt.Component.size() , toString sample code for java.awt.Component.toString() definition code for java.awt.Component.toString() , transferFocus sample code for java.awt.Component.transferFocus() definition code for java.awt.Component.transferFocus() , transferFocusBackward sample code for java.awt.Component.transferFocusBackward() definition code for java.awt.Component.transferFocusBackward() , transferFocusUpCycle sample code for java.awt.Component.transferFocusUpCycle() definition code for java.awt.Component.transferFocusUpCycle() , update sample code for java.awt.Component.update(java.awt.Graphics) definition code for java.awt.Component.update(java.awt.Graphics) , validate sample code for java.awt.Component.validate() definition code for java.awt.Component.validate()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

HORIZONTAL sample code for java.awt.Scrollbar.HORIZONTAL

public static final int HORIZONTAL
A constant that indicates a horizontal scroll bar.

See Also:
Constant Field Values

VERTICAL sample code for java.awt.Scrollbar.VERTICAL

public static final int VERTICAL
A constant that indicates a vertical scroll bar.

See Also:
Constant Field Values
Constructor Detail

Scrollbar sample code for java.awt.Scrollbar() definition code for java.awt.Scrollbar()

public Scrollbar()
          throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
Constructs a new vertical scroll bar. The default properties of the scroll bar are listed in the following table:

Property Description Default Value
orientation indicates whether the scroll bar is vertical
or horizontal
Scrollbar.VERTICAL
value value which controls the location
of the scroll bar's bubble
0
visible amount visible amount of the scroll bar's range,
typically represented by the size of the
scroll bar's bubble
10
minimum minimum value of the scroll bar 0
maximum maximum value of the scroll bar 100
unit increment amount the value changes when the
Line Up or Line Down key is pressed,
or when the end arrows of the scrollbar
are clicked
1
block increment amount the value changes when the
Page Up or Page Down key is pressed,
or when the scrollbar track is clicked
on either side of the bubble
10

Throws:
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless() returns true.
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

Scrollbar sample code for java.awt.Scrollbar(int) definition code for java.awt.Scrollbar(int)

public Scrollbar(int orientation)
          throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
Constructs a new scroll bar with the specified orientation.

The orientation argument must take one of the two values Scrollbar.HORIZONTAL, or Scrollbar.VERTICAL, indicating a horizontal or vertical scroll bar, respectively.

Parameters:
orientation - indicates the orientation of the scroll bar
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - when an illegal value for the orientation argument is supplied
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless() returns true.
See Also:
GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()

Scrollbar sample code for java.awt.Scrollbar(int, int, int, int, int) definition code for java.awt.Scrollbar(int, int, int, int, int)

public Scrollbar(int orientation,
                 int value,
                 int visible,
                 int minimum,
                 int maximum)
          throws HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException 
Constructs a new scroll bar with the specified orientation, initial value, visible amount, and minimum and maximum values.

The orientation argument must take one of the two values Scrollbar.HORIZONTAL, or Scrollbar.VERTICAL, indicating a horizontal or vertical scroll bar, respectively.

The parameters supplied to this constructor are subject to the constraints described in setValues(int, int, int, int) sample code for java.awt.Scrollbar.setValues(int, int, int, int) definition code for java.awt.Scrollbar.setValues(int, int, int, int) .

Parameters:
orientation - indicates the orientation of the scroll bar.
value - the initial value of the scroll bar
visible - the visible amount of the scroll bar, typically represented by the size of the bubble
minimum - the minimum value of the scroll bar
maximum - the maximum value of the scroll bar
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - when an illegal value for the orientation argument is supplied
HeadlessException sample code for java.awt.HeadlessException definition code for java.awt.HeadlessException - if GraphicsEnvironment.isHeadless() returns true.
See Also:
setValues(int, int, int, int) sample code for java.awt.Scrollbar.setValues(int, int, int, int) definition code for java.awt.Scrollbar.setValues(int, int, int, int) , GraphicsEnvironment.isHeadless() sample code for java.awt.GraphicsEnvironment.isHeadless() definition code for java.awt.GraphicsEnvironment.isHeadless()
Method Detail

addNotify sample code for java.awt.Scrollbar.addNotify() definition code for java.awt.Scrollbar.addNotify()

public void addNotify()
Creates the Scrollbar's peer. The peer allows you to modify the appearance of the Scrollbar without changing any of its functionality.

Overrides:
addNotify sample code for java.awt.Component.addNotify() definition code for java.awt.Component.addNotify() in class Component sample code for java.awt.Component definition code for java.awt.Component
See Also:
Component.isDisplayable() sample code for java.awt.Component.isDisplayable() definition code for java.awt.Component.isDisplayable() , Component.removeNotify() sample code for java.awt.Component.removeNotify() definition code for java.awt.Component.removeNotify()

getOrientation sample code for java.awt.Scrollbar.getOrientation() definition code for java.awt.Scrollbar.getOrientation()

public int getOrientation()
Returns the orientation of this scroll bar.

Specified by:
getOrientation sample code for java.awt.Adjustable.getOrientation() definition code for java.awt.Adjustable.getOrientation() in interface Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable
Returns:
the orientation of this scroll bar, either Scrollbar.HORIZONTAL or Scrollbar.VERTICAL
See Also:
setOrientation(int) sample code for java.awt.Scrollbar.setOrientation(int) definition code for java.awt.Scrollbar.setOrientation(int)

setOrientation sample code for java.awt.Scrollbar.setOrientation(int) definition code for java.awt.Scrollbar.setOrientation(int)

public void setOrientation(int orientation)
Sets the orientation for this scroll bar.

Parameters:
orientation - the orientation of this scroll bar, either Scrollbar.HORIZONTAL or Scrollbar.VERTICAL
Throws:
IllegalArgumentException sample code for java.lang.IllegalArgumentException definition code for java.lang.IllegalArgumentException - if the value supplied for orientation is not a legal value
Since:
JDK1.1
See Also:
getOrientation() sample code for java.awt.Scrollbar.getOrientation() definition code for java.awt.Scrollbar.getOrientation()

getValue sample code for java.awt.Scrollbar.getValue() definition code for java.awt.Scrollbar.getValue()

public int getValue()
Gets the current value of this scroll bar.

Specified by:
getValue sample code for java.awt.Adjustable.getValue() definition code for java.awt.Adjustable.getValue() in interface Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable
Returns:
the current value of this scroll bar
See Also:
getMinimum() sample code for java.awt.Scrollbar.getMinimum() definition code for java.awt.Scrollbar.getMinimum() , getMaximum() sample code for java.awt.Scrollbar.getMaximum() definition code for java.awt.Scrollbar.getMaximum()

setValue sample code for java.awt.Scrollbar.setValue(int) definition code for java.awt.Scrollbar.setValue(int)

public void setValue(int newValue)
Sets the value of this scroll bar to the specified value.

If the value supplied is less than the current minimum or greater than the current maximum - visibleAmount, then either minimum or maximum - visibleAmount is substituted, as appropriate.

Normally, a program should change a scroll bar's value only by calling setValues. The setValues method simultaneously and synchronously sets the minimum, maximum, visible amount, and value properties of a scroll bar, so that they are mutually consistent.

Calling this method does not fire an AdjustmentEvent.

Specified by:
setValue sample code for java.awt.Adjustable.setValue(int) definition code for java.awt.Adjustable.setValue(int) in interface Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable
Parameters:
newValue - the new value of the scroll bar
See Also:
setValues(int, int, int, int) sample code for java.awt.Scrollbar.setValues(int, int, int, int) definition code for java.awt.Scrollbar.setValues(int, int, int, int) , getValue() sample code for java.awt.Scrollbar.getValue() definition code for java.awt.Scrollbar.getValue() , getMinimum() sample code for java.awt.Scrollbar.getMinimum() definition code for java.awt.Scrollbar.getMinimum() , getMaximum() sample code for java.awt.Scrollbar.getMaximum() definition code for java.awt.Scrollbar.getMaximum()

getMinimum sample code for java.awt.Scrollbar.getMinimum() definition code for java.awt.Scrollbar.getMinimum()

public int getMinimum()
Gets the minimum value of this scroll bar.

Specified by:
getMinimum sample code for java.awt.Adjustable.getMinimum() definition code for java.awt.Adjustable.getMinimum() in interface Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable
Returns:
the minimum value of this scroll bar
See Also:
getValue() sample code for java.awt.Scrollbar.getValue() definition code for java.awt.Scrollbar.getValue() , getMaximum() sample code for java.awt.Scrollbar.getMaximum() definition code for java.awt.Scrollbar.getMaximum()

setMinimum sample code for java.awt.Scrollbar.setMinimum(int) definition code for java.awt.Scrollbar.setMinimum(int)

public void setMinimum(int newMinimum)
Sets the minimum value of this scroll bar.

When setMinimum is called, the minimum value is changed, and other values (including the maximum, the visible amount, and the current scroll bar value) are changed to be consistent with the new minimum.

Normally, a program should change a scroll bar's minimum value only by calling setValues. The setValues method simultaneously and synchronously sets the minimum, maximum, visible amount, and value properties of a scroll bar, so that they are mutually consistent.

Note that setting the minimum value to Integer.MAX_VALUE will result in the new minimum value being set to Integer.MAX_VALUE - 1.

Specified by:
setMinimum sample code for java.awt.Adjustable.setMinimum(int) definition code for java.awt.Adjustable.setMinimum(int) in interface Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable
Parameters:
newMinimum - the new minimum value for this scroll bar
Since:
JDK1.1
See Also:
setValues(int, int, int, int) sample code for java.awt.Scrollbar.setValues(int, int, int, int) definition code for java.awt.Scrollbar.setValues(int, int, int, int) , setMaximum(int) sample code for java.awt.Scrollbar.setMaximum(int) definition code for java.awt.Scrollbar.setMaximum(int)

getMaximum sample code for java.awt.Scrollbar.getMaximum() definition code for java.awt.Scrollbar.getMaximum()

public int getMaximum()
Gets the maximum value of this scroll bar.

Specified by:
getMaximum sample code for java.awt.Adjustable.getMaximum() definition code for java.awt.Adjustable.getMaximum() in interface Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable
Returns:
the maximum value of this scroll bar
See Also:
getValue() sample code for java.awt.Scrollbar.getValue() definition code for java.awt.Scrollbar.getValue() , getMinimum() sample code for java.awt.Scrollbar.getMinimum() definition code for java.awt.Scrollbar.getMinimum()

setMaximum sample code for java.awt.Scrollbar.setMaximum(int) definition code for java.awt.Scrollbar.setMaximum(int)

public void setMaximum(int newMaximum)
Sets the maximum value of this scroll bar.

When setMaximum is called, the maximum value is changed, and other values (including the minimum, the visible amount, and the current scroll bar value) are changed to be consistent with the new maximum.

Normally, a program should change a scroll bar's maximum value only by calling setValues. The setValues method simultaneously and synchronously sets the minimum, maximum, visible amount, and value properties of a scroll bar, so that they are mutually consistent.

Note that setting the maximum value to Integer.MIN_VALUE will result in the new maximum value being set to Integer.MIN_VALUE + 1.

Specified by:
setMaximum sample code for java.awt.Adjustable.setMaximum(int) definition code for java.awt.Adjustable.setMaximum(int) in interface Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable
Parameters:
newMaximum - the new maximum value for this scroll bar
Since:
JDK1.1
See Also:
setValues(int, int, int, int) sample code for java.awt.Scrollbar.setValues(int, int, int, int) definition code for java.awt.Scrollbar.setValues(int, int, int, int) , setMinimum(int) sample code for java.awt.Scrollbar.setMinimum(int) definition code for java.awt.Scrollbar.setMinimum(int)

getVisibleAmount sample code for java.awt.Scrollbar.getVisibleAmount() definition code for java.awt.Scrollbar.getVisibleAmount()

public int getVisibleAmount()
Gets the visible amount of this scroll bar.

When a scroll bar is used to select a range of values, the visible amount is used to represent the range of values that are currently visible. The size of the scroll bar's bubble (also called a thumb or scroll box), usually gives a visual representation of the relationship of the visible amount to the range of the scroll bar.

The scroll bar's bubble may not be displayed when it is not moveable (e.g. when it takes up the entire length of the scroll bar's track, or when the scroll bar is disabled). Whether the bubble is displayed or not will not affect the value returned by getVisibleAmount.

Specified by:
getVisibleAmount sample code for java.awt.Adjustable.getVisibleAmount() definition code for java.awt.Adjustable.getVisibleAmount() in interface Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable
Returns:
the visible amount of this scroll bar
Since:
JDK1.1
See Also:
setVisibleAmount(int) sample code for java.awt.Scrollbar.setVisibleAmount(int) definition code for java.awt.Scrollbar.setVisibleAmount(int)

getVisible sample code for java.awt.Scrollbar.getVisible() definition code for java.awt.Scrollbar.getVisible()

@Deprecated
public int getVisible()
Deprecated. As of JDK version 1.1, replaced by getVisibleAmount().


setVisibleAmount sample code for java.awt.Scrollbar.setVisibleAmount(int) definition code for java.awt.Scrollbar.setVisibleAmount(int)

public void setVisibleAmount(int newAmount)
Sets the visible amount of this scroll bar.

When a scroll bar is used to select a range of values, the visible amount is used to represent the range of values that are currently visible. The size of the scroll bar's bubble (also called a thumb or scroll box), usually gives a visual representation of the relationship of the visible amount to the range of the scroll bar.

The scroll bar's bubble may not be displayed when it is not moveable (e.g. when it takes up the entire length of the scroll bar's track, or when the scroll bar is disabled). Whether the bubble is displayed or not will not affect the value returned by getVisibleAmount.

If the visible amount supplied is less than one or greater than the current maximum - minimum, then either one or maximum - minimum is substituted, as appropriate.

Normally, a program should change a scroll bar's value only by calling setValues. The setValues method simultaneously and synchronously sets the minimum, maximum, visible amount, and value properties of a scroll bar, so that they are mutually consistent.

Specified by:
setVisibleAmount sample code for java.awt.Adjustable.setVisibleAmount(int) definition code for java.awt.Adjustable.setVisibleAmount(int) in interface Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable
Parameters:
newAmount - the new visible amount
Since:
JDK1.1
See Also:
getVisibleAmount() sample code for java.awt.Scrollbar.getVisibleAmount() definition code for java.awt.Scrollbar.getVisibleAmount() , setValues(int, int, int, int) sample code for java.awt.Scrollbar.setValues(int, int, int, int) definition code for java.awt.Scrollbar.setValues(int, int, int, int)

setUnitIncrement sample code for java.awt.Scrollbar.setUnitIncrement(int) definition code for java.awt.Scrollbar.setUnitIncrement(int)

public void setUnitIncrement(int v)
Sets the unit increment for this scroll bar.

The unit increment is the value that is added or subtracted when the user activates the unit increment area of the scroll bar, generally through a mouse or keyboard gesture that the scroll bar receives as an adjustment event. The unit increment must be greater than zero. Attepts to set the unit increment to a value lower than 1 will result in a value of 1 being set.

Specified by:
setUnitIncrement sample code for java.awt.Adjustable.setUnitIncrement(int) definition code for java.awt.Adjustable.setUnitIncrement(int) in interface Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable
Parameters:
v - the amount by which to increment or decrement the scroll bar's value
Since:
JDK1.1
See Also:
getUnitIncrement() sample code for java.awt.Scrollbar.getUnitIncrement() definition code for java.awt.Scrollbar.getUnitIncrement()

setLineIncrement sample code for java.awt.Scrollbar.setLineIncrement(int) definition code for java.awt.Scrollbar.setLineIncrement(int)

@Deprecated
public void setLineIncrement(int v)
Deprecated. As of JDK version 1.1, replaced by setUnitIncrement(int).


getUnitIncrement sample code for java.awt.Scrollbar.getUnitIncrement() definition code for java.awt.Scrollbar.getUnitIncrement()

public int getUnitIncrement()
Gets the unit increment for this scrollbar.

The unit increment is the value that is added or subtracted when the user activates the unit increment area of the scroll bar, generally through a mouse or keyboard gesture that the scroll bar receives as an adjustment event. The unit increment must be greater than zero.

Specified by:
getUnitIncrement sample code for java.awt.Adjustable.getUnitIncrement() definition code for java.awt.Adjustable.getUnitIncrement() in interface Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable
Returns:
the unit increment of this scroll bar
Since:
JDK1.1
See Also:
setUnitIncrement(int) sample code for java.awt.Scrollbar.setUnitIncrement(int) definition code for java.awt.Scrollbar.setUnitIncrement(int)

getLineIncrement sample code for java.awt.Scrollbar.getLineIncrement() definition code for java.awt.Scrollbar.getLineIncrement()

@Deprecated
public int getLineIncrement()
Deprecated. As of JDK version 1.1, replaced by getUnitIncrement().


setBlockIncrement sample code for java.awt.Scrollbar.setBlockIncrement(int) definition code for java.awt.Scrollbar.setBlockIncrement(int)

public void setBlockIncrement(int v)
Sets the block increment for this scroll bar.

The block increment is the value that is added or subtracted when the user activates the block increment area of the scroll bar, generally through a mouse or keyboard gesture that the scroll bar receives as an adjustment event. The block increment must be greater than zero. Attepts to set the block increment to a value lower than 1 will result in a value of 1 being set.

Specified by:
setBlockIncrement sample code for java.awt.Adjustable.setBlockIncrement(int) definition code for java.awt.Adjustable.setBlockIncrement(int) in interface Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable
Parameters:
v - the amount by which to increment or decrement the scroll bar's value
Since:
JDK1.1
See Also:
getBlockIncrement() sample code for java.awt.Scrollbar.getBlockIncrement() definition code for java.awt.Scrollbar.getBlockIncrement()

setPageIncrement sample code for java.awt.Scrollbar.setPageIncrement(int) definition code for java.awt.Scrollbar.setPageIncrement(int)

@Deprecated
public void setPageIncrement(int v)
Deprecated. As of JDK version 1.1, replaced by setBlockIncrement().


getBlockIncrement sample code for java.awt.Scrollbar.getBlockIncrement() definition code for java.awt.Scrollbar.getBlockIncrement()

public int getBlockIncrement()
Gets the block increment of this scroll bar.

The block increment is the value that is added or subtracted when the user activates the block increment area of the scroll bar, generally through a mouse or keyboard gesture that the scroll bar receives as an adjustment event. The block increment must be greater than zero.

Specified by:
getBlockIncrement sample code for java.awt.Adjustable.getBlockIncrement() definition code for java.awt.Adjustable.getBlockIncrement() in interface Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable
Returns:
the block increment of this scroll bar
Since:
JDK1.1
See Also:
setBlockIncrement(int) sample code for java.awt.Scrollbar.setBlockIncrement(int) definition code for java.awt.Scrollbar.setBlockIncrement(int)

getPageIncrement sample code for java.awt.Scrollbar.getPageIncrement() definition code for java.awt.Scrollbar.getPageIncrement()

@Deprecated
public int getPageIncrement()
Deprecated. As of JDK version 1.1, replaced by getBlockIncrement().


setValues sample code for java.awt.Scrollbar.setValues(int, int, int, int) definition code for java.awt.Scrollbar.setValues(int, int, int, int)

public void setValues(int value,
                      int visible,
                      int minimum,
                      int maximum)
Sets the values of four properties for this scroll bar: value, visibleAmount, minimum, and maximum. If the values supplied for these properties are inconsistent or incorrect, they will be changed to ensure consistency.

This method simultaneously and synchronously sets the values of four scroll bar properties, assuring that the values of these properties are mutually consistent. It enforces the following constraints: maximum must be greater than minimum, maximum - minimum must not be greater than Integer.MAX_VALUE, visibleAmount must be greater than zero. visibleAmount must not be greater than maximum - minimum, value must not be less than minimum, and value must not be greater than maximum - visibleAmount

Calling this method does not fire an AdjustmentEvent.

Parameters:
value - is the position in the current window
visible - is the visible amount of the scroll bar
minimum - is the minimum value of the scroll bar
maximum - is the maximum value of the scroll bar
See Also:
setMinimum(int) sample code for java.awt.Scrollbar.setMinimum(int) definition code for java.awt.Scrollbar.setMinimum(int) , setMaximum(int) sample code for java.awt.Scrollbar.setMaximum(int) definition code for java.awt.Scrollbar.setMaximum(int) , setVisibleAmount(int) sample code for java.awt.Scrollbar.setVisibleAmount(int) definition code for java.awt.Scrollbar.setVisibleAmount(int) , setValue(int) sample code for java.awt.Scrollbar.setValue(int) definition code for java.awt.Scrollbar.setValue(int)

getValueIsAdjusting sample code for java.awt.Scrollbar.getValueIsAdjusting() definition code for java.awt.Scrollbar.getValueIsAdjusting()

public boolean getValueIsAdjusting()
Returns true if the value is in the process of changing as a result of actions being taken by the user.

Returns:
the value of the valueIsAdjusting property
Since:
1.4
See Also:
setValueIsAdjusting(boolean) sample code for java.awt.Scrollbar.setValueIsAdjusting(boolean) definition code for java.awt.Scrollbar.setValueIsAdjusting(boolean)

setValueIsAdjusting sample code for java.awt.Scrollbar.setValueIsAdjusting(boolean) definition code for java.awt.Scrollbar.setValueIsAdjusting(boolean)

public void setValueIsAdjusting(boolean b)
Sets the valueIsAdjusting property.

Parameters:
b - new adjustment-in-progress status
Since:
1.4
See Also:
getValueIsAdjusting() sample code for java.awt.Scrollbar.getValueIsAdjusting() definition code for java.awt.Scrollbar.getValueIsAdjusting()

addAdjustmentListener sample code for java.awt.Scrollbar.addAdjustmentListener(java.awt.event.AdjustmentListener) definition code for java.awt.Scrollbar.addAdjustmentListener(java.awt.event.AdjustmentListener)

public void addAdjustmentListener(AdjustmentListener sample code for java.awt.event.AdjustmentListener definition code for java.awt.event.AdjustmentListener  l)
Adds the specified adjustment listener to receive instances of AdjustmentEvent from this scroll bar. If l is null, no exception is thrown and no action is performed.

Specified by:
addAdjustmentListener sample code for java.awt.Adjustable.addAdjustmentListener(java.awt.event.AdjustmentListener) definition code for java.awt.Adjustable.addAdjustmentListener(java.awt.event.AdjustmentListener) in interface Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable
Parameters:
l - the adjustment listener
Since:
JDK1.1
See Also:
removeAdjustmentListener(java.awt.event.AdjustmentListener) sample code for java.awt.Scrollbar.removeAdjustmentListener(java.awt.event.AdjustmentListener) definition code for java.awt.Scrollbar.removeAdjustmentListener(java.awt.event.AdjustmentListener) , getAdjustmentListeners() sample code for java.awt.Scrollbar.getAdjustmentListeners() definition code for java.awt.Scrollbar.getAdjustmentListeners() , AdjustmentEvent sample code for java.awt.event.AdjustmentEvent definition code for java.awt.event.AdjustmentEvent , AdjustmentListener sample code for java.awt.event.AdjustmentListener definition code for java.awt.event.AdjustmentListener

removeAdjustmentListener sample code for java.awt.Scrollbar.removeAdjustmentListener(java.awt.event.AdjustmentListener) definition code for java.awt.Scrollbar.removeAdjustmentListener(java.awt.event.AdjustmentListener)

public void removeAdjustmentListener(AdjustmentListener sample code for java.awt.event.AdjustmentListener definition code for java.awt.event.AdjustmentListener  l)
Removes the specified adjustment listener so that it no longer receives instances of AdjustmentEvent from this scroll bar. If l is null, no exception is thrown and no action is performed.

Specified by:
removeAdjustmentListener sample code for java.awt.Adjustable.removeAdjustmentListener(java.awt.event.AdjustmentListener) definition code for java.awt.Adjustable.removeAdjustmentListener(java.awt.event.AdjustmentListener) in interface Adjustable sample code for java.awt.Adjustable definition code for java.awt.Adjustable
Parameters:
l - the adjustment listener
Since:
JDK1.1
See Also:
addAdjustmentListener(java.awt.event.AdjustmentListener) sample code for java.awt.Scrollbar.addAdjustmentListener(java.awt.event.AdjustmentListener) definition code for java.awt.Scrollbar.addAdjustmentListener(java.awt.event.AdjustmentListener) , getAdjustmentListeners() sample code for java.awt.Scrollbar.getAdjustmentListeners() definition code for java.awt.Scrollbar.getAdjustmentListeners() , AdjustmentEvent sample code for java.awt.event.AdjustmentEvent definition code for java.awt.event.AdjustmentEvent , AdjustmentListener sample code for java.awt.event.AdjustmentListener definition code for java.awt.event.AdjustmentListener

getAdjustmentListeners sample code for java.awt.Scrollbar.getAdjustmentListeners() definition code for java.awt.Scrollbar.getAdjustmentListeners()

public AdjustmentListener sample code for java.awt.event.AdjustmentListener definition code for java.awt.event.AdjustmentListener [] getAdjustmentListeners()
Returns an array of all the adjustment listeners registered on this scrollbar.

Returns:
all of this scrollbar's AdjustmentListeners or an empty array if no adjustment listeners are currently registered
Since:
1.4
See Also:
addAdjustmentListener(java.awt.event.AdjustmentListener) sample code for java.awt.Scrollbar.addAdjustmentListener(java.awt.event.AdjustmentListener) definition code for java.awt.Scrollbar.addAdjustmentListener(java.awt.event.AdjustmentListener) , removeAdjustmentListener(java.awt.event.AdjustmentListener) sample code for java.awt.Scrollbar.removeAdjustmentListener(java.awt.event.AdjustmentListener) definition code for java.awt.Scrollbar.removeAdjustmentListener(java.awt.event.AdjustmentListener) , AdjustmentEvent sample code for java.awt.event.AdjustmentEvent definition code for java.awt.event.AdjustmentEvent , AdjustmentListener sample code for java.awt.event.AdjustmentListener definition code for java.awt.event.AdjustmentListener

getListeners sample code for java.awt.Scrollbar.<T extends java.util.EventListener>getListeners(java.lang.Class<T>) definition code for java.awt.Scrollbar.<T extends java.util.EventListener>getListeners(java.lang.Class<T>)

public <T extends EventListener sample code for java.util.EventListener definition code for java.util.EventListener > T[] getListeners(Class sample code for java.lang.Class definition code for java.lang.Class <T> listenerType)
Returns an array of all the objects currently registered as FooListeners upon this Scrollbar. FooListeners are registered using the addFooListener method.

You can specify the listenerType argument with a class literal, such as FooListener.class. For example, you can query a Scrollbar c for its mouse listeners with the following code:

MouseListener[] mls = (MouseListener[])(c.getListeners(MouseListener.class));
If no such listeners exist, this method returns an empty array.

Overrides:
getListeners sample code for java.awt.Component.getListeners(java.lang.Class) definition code for java.awt.Component.getListeners(java.lang.Class) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
listenerType - the type of listeners requested; this parameter should specify an interface that descends from java.util.EventListener
Returns:
an array of all objects registered as FooListeners on this component, or an empty array if no such listeners have been added
Throws:
ClassCastException sample code for java.lang.ClassCastException definition code for java.lang.ClassCastException - if listenerType doesn't specify a class or interface that implements java.util.EventListener
Since:
1.3
See Also:
Component.getComponentListeners() sample code for java.awt.Component.getComponentListeners() definition code for java.awt.Component.getComponentListeners() , Component.getFocusListeners() sample code for java.awt.Component.getFocusListeners() definition code for java.awt.Component.getFocusListeners() , Component.getHierarchyListeners() sample code for java.awt.Component.getHierarchyListeners() definition code for java.awt.Component.getHierarchyListeners() , Component.getHierarchyBoundsListeners() sample code for java.awt.Component.getHierarchyBoundsListeners() definition code for java.awt.Component.getHierarchyBoundsListeners() , Component.getKeyListeners() sample code for java.awt.Component.getKeyListeners() definition code for java.awt.Component.getKeyListeners() , Component.getMouseListeners() sample code for java.awt.Component.getMouseListeners() definition code for java.awt.Component.getMouseListeners() , Component.getMouseMotionListeners() sample code for java.awt.Component.getMouseMotionListeners() definition code for java.awt.Component.getMouseMotionListeners() , Component.getMouseWheelListeners() sample code for java.awt.Component.getMouseWheelListeners() definition code for java.awt.Component.getMouseWheelListeners() , Component.getInputMethodListeners() sample code for java.awt.Component.getInputMethodListeners() definition code for java.awt.Component.getInputMethodListeners() , Component.getPropertyChangeListeners() sample code for java.awt.Component.getPropertyChangeListeners() definition code for java.awt.Component.getPropertyChangeListeners()

processEvent sample code for java.awt.Scrollbar.processEvent(java.awt.AWTEvent) definition code for java.awt.Scrollbar.processEvent(java.awt.AWTEvent)

protected void processEvent(AWTEvent sample code for java.awt.AWTEvent definition code for java.awt.AWTEvent  e)
Processes events on this scroll bar. If the event is an instance of AdjustmentEvent, it invokes the processAdjustmentEvent method. Otherwise, it invokes its superclass's processEvent method.

Note that if the event parameter is null the behavior is unspecified and may result in an exception.

Overrides:
processEvent sample code for java.awt.Component.processEvent(java.awt.AWTEvent) definition code for java.awt.Component.processEvent(java.awt.AWTEvent) in class Component sample code for java.awt.Component definition code for java.awt.Component
Parameters:
e - the event
Since:
JDK1.1
See Also:
AdjustmentEvent sample code for java.awt.event.AdjustmentEvent definition code for java.awt.event.AdjustmentEvent , processAdjustmentEvent(java.awt.event.AdjustmentEvent) sample code for java.awt.Scrollbar.processAdjustmentEvent(java.awt.event.AdjustmentEvent) definition code for java.awt.Scrollbar.processAdjustmentEvent(java.awt.event.AdjustmentEvent)

processAdjustmentEvent sample code for java.awt.Scrollbar.processAdjustmentEvent(java.awt.event.AdjustmentEvent) definition code for java.awt.Scrollbar.processAdjustmentEvent(java.awt.event.AdjustmentEvent)

protected void processAdjustmentEvent(AdjustmentEvent sample code for java.awt.event.AdjustmentEvent definition code for java.awt.event.AdjustmentEvent  e)
Processes adjustment events occurring on this scrollbar by dispatching them to any registered AdjustmentListener objects.

This method is not called unless adjustment events are enabled for this component. Adjustment events are enabled when one of the following occurs:

Note that if the event parameter is null the behavior is unspecified and may result in an exception.

Parameters:
e - the adjustment event
Since:
JDK1.1
See Also:
AdjustmentEvent sample code for java.awt.event.AdjustmentEvent definition code for java.awt.event.AdjustmentEvent , AdjustmentListener sample code for java.awt.event.AdjustmentListener definition code for java.awt.event.AdjustmentListener , addAdjustmentListener(java.awt.event.AdjustmentListener) sample code for java.awt.Scrollbar.addAdjustmentListener(java.awt.event.AdjustmentListener) definition code for java.awt.Scrollbar.addAdjustmentListener(java.awt.event.AdjustmentListener) , Component.enableEvents(long) sample code for java.awt.Component.enableEvents(long) definition code for java.awt.Component.enableEvents(long)

paramString sample code for java.awt.Scrollbar.paramString() definition code for java.awt.Scrollbar.paramString()

protected String sample code for java.lang.String definition code for java.lang.String  paramString()
Returns a string representing the state of this Scrollbar. 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.

Overrides:
paramString sample code for java.awt.Component.paramString() definition code for java.awt.Component.paramString() in class Component sample code for java.awt.Component definition code for java.awt.Component
Returns:
the parameter string of this scroll bar

getAccessibleContext sample code for java.awt.Scrollbar.getAccessibleContext() definition code for java.awt.Scrollbar.getAccessibleContext()

public AccessibleContext sample code for javax.accessibility.AccessibleContext definition code for javax.accessibility.AccessibleContext  getAccessibleContext()
Gets the AccessibleContext associated with this Scrollbar. For scrollbars, the AccessibleContext takes the form of an AccessibleAWTScrollBar. A new AccessibleAWTScrollBar instance is created if necessary.

Specified by:
getAccessibleContext sample code for javax.accessibility.Accessible.getAccessibleContext() definition code for javax.accessibility.Accessible.getAccessibleContext() in interface Accessible sample code for javax.accessibility.Accessible definition code for javax.accessibility.Accessible
Overrides:
getAccessibleContext sample code for java.awt.Component.getAccessibleContext() definition code for java.awt.Component.getAccessibleContext() in class Component sample code for java.awt.Component definition code for java.awt.Component
Returns:
an AccessibleAWTScrollBar that serves as the AccessibleContext of this ScrollBar