All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class java.awt.Scrollbar

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Scrollbar

public class Scrollbar
extends Component
implements Adjustable
A Scrollbar component which implements the Adjustable interface.


Variable Index

 o HORIZONTAL
The horizontal Scrollbar variable.
 o VERTICAL
The vertical Scrollbar variable.

Constructor Index

 o Scrollbar()
Constructs a new vertical Scrollbar.
 o Scrollbar(int)
Constructs a new Scrollbar with the specified orientation.
 o Scrollbar(int, int, int, int, int)
Constructs a new Scrollbar with the specified orientation, value, page size, and minumum and maximum values.

Method Index

 o addAdjustmentListener(AdjustmentListener)
Adds the specified adjustment listener to recieve adjustment events from this scrollbar.
 o addNotify()
Creates the Scrollbar's peer.
 o getBlockIncrement()
Gets the block increment for this scrollbar.
 o getLineIncrement()
Deprecated.
 o getMaximum()
Returns the maximum value of this Scrollbar.
 o getMinimum()
Returns the minimum value of this Scrollbar.
 o getOrientation()
Returns the orientation for this Scrollbar.
 o getPageIncrement()
Deprecated.
 o getUnitIncrement()
Gets the unit increment for this scrollbar.
 o getValue()
Returns the current value of this Scrollbar.
 o getVisible()
Deprecated.
 o getVisibleAmount()
Returns the visible amount of this Scrollbar.
 o paramString()
Returns the String parameters for this Scrollbar.
 o processAdjustmentEvent(AdjustmentEvent)
Processes adjustment events occurring on this scrollbar by dispatching them to any registered AdjustmentListener objects.
 o processEvent(AWTEvent)
Processes events on this scrollbar.
 o removeAdjustmentListener(AdjustmentListener)
Removes the specified adjustment listener so that it no longer receives adjustment events from this scrollbar..
 o setBlockIncrement(int)
Sets the block increment for this scrollbar.
 o setLineIncrement(int)
Deprecated.
 o setMaximum(int)
Sets the maximum value for this Scrollbar.
 o setMinimum(int)
Sets the minimum value for this Scrollbar.
 o setOrientation(int)
Sets the orientation for this Scrollbar.
 o setPageIncrement(int)
Deprecated.
 o setUnitIncrement(int)
Sets the unit increment for this scrollbar.
 o setValue(int)
Sets the value of this Scrollbar to the specified value.
 o setValues(int, int, int, int)
Sets the values for this Scrollbar.
 o setVisibleAmount(int)
Sets the visible amount of this Scrollbar, which is the range of values represented by the width of the scroll bar's bubble.

Variables

 o HORIZONTAL
 public static final int HORIZONTAL
The horizontal Scrollbar variable.

 o VERTICAL
 public static final int VERTICAL
The vertical Scrollbar variable.

Constructors

 o Scrollbar
 public Scrollbar()
Constructs a new vertical Scrollbar.

 o Scrollbar
 public Scrollbar(int orientation)
Constructs a new Scrollbar with the specified orientation.

Parameters:
orientation - either Scrollbar.HORIZONTAL or Scrollbar.VERTICAL
Throws: IllegalArgumentException
When an illegal scrollbar orientation is given.
 o Scrollbar
 public Scrollbar(int orientation,
                  int value,
                  int visible,
                  int minimum,
                  int maximum)
Constructs a new Scrollbar with the specified orientation, value, page size, and minumum and maximum values.

Parameters:
orientation - either Scrollbar.HORIZONTAL or Scrollbar.VERTICAL
value - the scrollbar's value
visible - the size of the visible portion of the scrollable area. The scrollbar will use this value when paging up or down by a page.
minimum - the minimum value of the scrollbar
maximum - the maximum value of the scrollbar

Methods

 o 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 in class Component
 o getOrientation
 public int getOrientation()
Returns the orientation for this Scrollbar.

 o setOrientation
 public synchronized void setOrientation(int orientation)
Sets the orientation for this Scrollbar.

Parameters:
orientation - the orientation (HORIZONTAL or VERTICAL) of this scrollbar.
 o getValue
 public int getValue()
Returns the current value of this Scrollbar.

See Also:
getMinimum, getMaximum
 o setValue
 public synchronized void setValue(int newValue)
Sets the value of this Scrollbar to the specified value.

Parameters:
value - the new value of the Scrollbar. If this value is below the current minimum or above the current maximum minus the visible amount, it becomes the new one of those values, respectively.
See Also:
getValue
 o getMinimum
 public int getMinimum()
Returns the minimum value of this Scrollbar.

See Also:
getMaximum, getValue
 o setMinimum
 public synchronized void setMinimum(int newMinimum)
Sets the minimum value for this Scrollbar.

Parameters:
minimum - the minimum value of the scrollbar
 o getMaximum
 public int getMaximum()
Returns the maximum value of this Scrollbar.

See Also:
getMinimum, getValue
 o setMaximum
 public synchronized void setMaximum(int newMaximum)
Sets the maximum value for this Scrollbar.

Parameters:
maximum - the maximum value of the scrollbar
 o getVisibleAmount
 public int getVisibleAmount()
Returns the visible amount of this Scrollbar.

 o getVisible
 public int getVisible()
Note: getVisible() is deprecated. As of JDK version 1.1, replaced by getVisibleAmount().

 o setVisibleAmount
 public synchronized void setVisibleAmount(int newAmount)
Sets the visible amount of this Scrollbar, which is the range of values represented by the width of the scroll bar's bubble.

Parameters:
visible - the amount visible per page
 o setUnitIncrement
 public synchronized void setUnitIncrement(int v)
Sets the unit increment for this scrollbar. This is the value that will be added (subtracted) when the user hits the unit down (up) gadgets.

 o setLineIncrement
 public void setLineIncrement(int v)
Note: setLineIncrement() is deprecated. As of JDK version 1.1, replaced by setUnitIncrement(int).

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

 o getLineIncrement
 public int getLineIncrement()
Note: getLineIncrement() is deprecated. As of JDK version 1.1, replaced by getUnitIncrement().

 o setBlockIncrement
 public synchronized void setBlockIncrement(int v)
Sets the block increment for this scrollbar. This is the value that will be added (subtracted) when the user hits the block down (up) gadgets.

 o setPageIncrement
 public void setPageIncrement(int v)
Note: setPageIncrement() is deprecated. As of JDK version 1.1, replaced by setBlockIncrement().

 o getBlockIncrement
 public int getBlockIncrement()
Gets the block increment for this scrollbar.

 o getPageIncrement
 public int getPageIncrement()
Note: getPageIncrement() is deprecated. As of JDK version 1.1, replaced by getBlockIncrement().

 o setValues
 public synchronized void setValues(int value,
                                    int visible,
                                    int minimum,
                                    int maximum)
Sets the values for this Scrollbar. This method enforces the following constraints: Values which do not meet these criteria are quietly coerced to the appropriate boundary value.

Parameters:
value - is the position in the current window.
visible - is the amount visible per page
minimum - is the minimum value of the scrollbar
maximum - is the maximum value of the scrollbar
 o addAdjustmentListener
 public synchronized void addAdjustmentListener(AdjustmentListener l)
Adds the specified adjustment listener to recieve adjustment events from this scrollbar.

Parameters:
l - the adjustment listener
 o removeAdjustmentListener
 public synchronized void removeAdjustmentListener(AdjustmentListener l)
Removes the specified adjustment listener so that it no longer receives adjustment events from this scrollbar..

 o processEvent
 protected void processEvent(AWTEvent e)
Processes events on this scrollbar. If the event is an AdjustmentEvent, it invokes the processAdjustmentEvent method, else it invokes its superclass's processEvent.

Parameters:
e - the event
Overrides:
processEvent in class Component
 o processAdjustmentEvent
 protected void processAdjustmentEvent(AdjustmentEvent e)
Processes adjustment events occurring on this scrollbar by dispatching them to any registered AdjustmentListener objects. NOTE: This method will not be called unless adjustment events are enabled for this component; this happens when one of the following occurs: a) An AdjustmentListener object is registered via addAdjustmentListener() b) Adjustment events are enabled via enableEvents()

Parameters:
e - the adjustment event
See Also:
enableEvents
 o paramString
 protected String paramString()
Returns the String parameters for this Scrollbar.

Overrides:
paramString in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index

Submit a bug or feature