Save This Page
Home » openjdk-7 » java » awt » [javadoc | source]
java.awt
public class: Scrollbar [javadoc | source]
java.lang.Object
   java.awt.Component
      java.awt.Scrollbar

All Implemented Interfaces:
    Accessible, Adjustable, MenuContainer, Serializable, ImageObserver

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 . If you use a Scrollbar for this purpose, you are likely to encounter issues with painting, key handling, sizing and positioning.

Nested Class Summary:
protected class  Scrollbar.AccessibleAWTScrollBar  This class implements accessibility support for the Scrollbar class. It provides an implementation of the Java Accessibility API appropriate to scrollbar user-interface elements. 
Field Summary
public static final  int HORIZONTAL    A constant that indicates a horizontal scroll bar. 
public static final  int VERTICAL    A constant that indicates a vertical scroll bar. 
 int value    The value of the Scrollbar. This property must be greater than or equal to minimum and less than or equal to maximum - visibleAmount 
 int maximum    The maximum value of the Scrollbar. This value must be greater than the minimum value.
 
 int minimum    The minimum value of the Scrollbar. This value must be less than the maximum value.
 
 int visibleAmount    The size of the Scrollbar's bubble. When a scroll bar is used to select a range of values, the visibleAmount represents the size of this range. Depending on platform, this may be visually indicated by the size of the bubble. 
 int orientation    The Scrollbar's orientation--being either horizontal or vertical. This value should be specified when the scrollbar is created.
orientation can be either : VERTICAL or HORIZONTAL only. 
 int lineIncrement    The amount by which the scrollbar value will change when going up or down by a line. This value must be greater than zero. 
 int pageIncrement    The amount by which the scrollbar value will change when going up or down by a page. This value must be greater than zero. 
transient  boolean isAdjusting    The adjusting status of the Scrollbar. True if the value is in the process of changing as a result of actions being taken by the user. 
transient  AdjustmentListener adjustmentListener     
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 Scrollbar() throws 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 - if GraphicsEnvironment.isHeadless() returns true.
    Also see:
    java.awt.GraphicsEnvironment#isHeadless
    exception: HeadlessException - if GraphicsEnvironment.isHeadless() returns true.
 public Scrollbar(int orientation) throws 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 - when an illegal value for the orientation argument is supplied
    HeadlessException - if GraphicsEnvironment.isHeadless() returns true.
    Also see:
    java.awt.GraphicsEnvironment#isHeadless
    exception: IllegalArgumentException - when an illegal value for the orientation argument is supplied
    exception: HeadlessException - if GraphicsEnvironment.isHeadless() returns true.
 public Scrollbar(int orientation,
    int value,
    int visible,
    int minimum,
    int maximum) throws 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) .

    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 - when an illegal value for the orientation argument is supplied
    HeadlessException - if GraphicsEnvironment.isHeadless() returns true.
    Also see:
    setValues
    java.awt.GraphicsEnvironment#isHeadless
    exception: IllegalArgumentException - when an illegal value for the orientation argument is supplied
    exception: HeadlessException - if GraphicsEnvironment.isHeadless() returns true.
Method from java.awt.Scrollbar Summary:
addAdjustmentListener,   addNotify,   constructComponentName,   eventEnabled,   getAccessibleContext,   getAdjustmentListeners,   getBlockIncrement,   getLineIncrement,   getListeners,   getMaximum,   getMinimum,   getOrientation,   getPageIncrement,   getUnitIncrement,   getValue,   getValueIsAdjusting,   getVisible,   getVisibleAmount,   paramString,   processAdjustmentEvent,   processEvent,   removeAdjustmentListener,   setBlockIncrement,   setLineIncrement,   setMaximum,   setMinimum,   setOrientation,   setPageIncrement,   setUnitIncrement,   setValue,   setValueIsAdjusting,   setValues,   setVisibleAmount
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 java.awt.Scrollbar Detail:
 public synchronized  void addAdjustmentListener(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.

    Refer to AWT Threading Issues for details on AWT's threading model.

 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.
 String constructComponentName() 
    Constructs a name for this component. Called by getName when the name is null.
 boolean eventEnabled(AWTEvent e) 
 public 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.
 public synchronized AdjustmentListener[] getAdjustmentListeners() 
    Returns an array of all the adjustment listeners registered on this scrollbar.
 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.

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

 public T[] getListeners(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.
 public int getMaximum() 
    Gets the maximum value of this scroll bar.
 public int getMinimum() 
    Gets the minimum value of this scroll bar.
 public int getOrientation() 
    Returns the orientation of this scroll bar.
 public int getPageIncrement() 
Deprecated! As - of JDK version 1.1, replaced by getBlockIncrement().

 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.

 public int getValue() 
    Gets the current value of this scroll bar.
 public boolean getValueIsAdjusting() 
    Returns true if the value is in the process of changing as a result of actions being taken by the user.
 public int getVisible() 
Deprecated! As - of JDK version 1.1, replaced by 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. Note that depending on platform, the value of the visible amount property may not be visually indicated by the size of the bubble.

    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.

 protected 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.
 protected  void processAdjustmentEvent(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:

    • An AdjustmentListener object is registered via addAdjustmentListener.
    • Adjustment events are enabled via enableEvents.

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

 protected  void processEvent(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.

 public synchronized  void removeAdjustmentListener(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.

    Refer to AWT Threading Issues for details on AWT's threading model.

 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.

 public synchronized  void setLineIncrement(int v) 
Deprecated! As - of JDK version 1.1, replaced by setUnitIncrement(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.

 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.

 public  void setOrientation(int orientation) 
    Sets the orientation for this scroll bar.
 public synchronized  void setPageIncrement(int v) 
Deprecated! As - of JDK version 1.1, replaced by setBlockIncrement().

 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.

 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.

 public  void setValueIsAdjusting(boolean b) 
    Sets the valueIsAdjusting property.
 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.

 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. Note that depending on platform, the value of the visible amount property may not be visually indicated by the size of the bubble.

    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.