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.
-
HORIZONTAL
- The horizontal Scrollbar variable.
-
VERTICAL
- The vertical Scrollbar variable.
-
Scrollbar()
- Constructs a new vertical Scrollbar.
-
Scrollbar(int)
- Constructs a new Scrollbar with the specified orientation.
-
Scrollbar(int, int, int, int, int)
- Constructs a new Scrollbar with the specified orientation,
value, page size, and minumum and maximum values.
-
addAdjustmentListener(AdjustmentListener)
- Adds the specified adjustment listener to recieve adjustment events
from this scrollbar.
-
addNotify()
- Creates the Scrollbar's peer.
-
getBlockIncrement()
- Gets the block increment for this scrollbar.
-
getLineIncrement()
-
Deprecated.
-
getMaximum()
- Returns the maximum value of this Scrollbar.
-
getMinimum()
- Returns the minimum value of this Scrollbar.
-
getOrientation()
- Returns the orientation for this Scrollbar.
-
getPageIncrement()
-
Deprecated.
-
getUnitIncrement()
- Gets the unit increment for this scrollbar.
-
getValue()
- Returns the current value of this Scrollbar.
-
getVisible()
-
Deprecated.
-
getVisibleAmount()
- Returns the visible amount of this Scrollbar.
-
paramString()
- Returns the String parameters for this Scrollbar.
-
processAdjustmentEvent(AdjustmentEvent)
-
Processes adjustment events occurring on this scrollbar by
dispatching them to any registered AdjustmentListener objects.
-
processEvent(AWTEvent)
- Processes events on this scrollbar.
-
removeAdjustmentListener(AdjustmentListener)
- Removes the specified adjustment listener so that it no longer
receives adjustment events from this scrollbar..
-
setBlockIncrement(int)
- Sets the block increment for this scrollbar.
-
setLineIncrement(int)
-
Deprecated.
-
setMaximum(int)
- Sets the maximum value for this Scrollbar.
-
setMinimum(int)
- Sets the minimum value for this Scrollbar.
-
setOrientation(int)
- Sets the orientation for this Scrollbar.
-
setPageIncrement(int)
-
Deprecated.
-
setUnitIncrement(int)
- Sets the unit increment for this scrollbar.
-
setValue(int)
- Sets the value of this Scrollbar to the specified value.
-
setValues(int, int, int, int)
- Sets the values for this Scrollbar.
-
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.
HORIZONTAL
public static final int HORIZONTAL
- The horizontal Scrollbar variable.
VERTICAL
public static final int VERTICAL
- The vertical Scrollbar variable.
Scrollbar
public Scrollbar()
- Constructs a new vertical Scrollbar.
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.
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
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
getOrientation
public int getOrientation()
- Returns the orientation for this Scrollbar.
setOrientation
public synchronized void setOrientation(int orientation)
- Sets the orientation for this Scrollbar.
- Parameters:
- orientation - the orientation (HORIZONTAL or VERTICAL) of
this scrollbar.
getValue
public int getValue()
- Returns the current value of this Scrollbar.
- See Also:
- getMinimum, getMaximum
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
getMinimum
public int getMinimum()
- Returns the minimum value of this Scrollbar.
- See Also:
- getMaximum, getValue
setMinimum
public synchronized void setMinimum(int newMinimum)
- Sets the minimum value for this Scrollbar.
- Parameters:
- minimum - the minimum value of the scrollbar
getMaximum
public int getMaximum()
- Returns the maximum value of this Scrollbar.
- See Also:
- getMinimum, getValue
setMaximum
public synchronized void setMaximum(int newMaximum)
- Sets the maximum value for this Scrollbar.
- Parameters:
- maximum - the maximum value of the scrollbar
getVisibleAmount
public int getVisibleAmount()
- Returns the visible amount of this Scrollbar.
getVisible
public int getVisible()
- Note: getVisible() is deprecated.
As of JDK version 1.1,
replaced by getVisibleAmount().
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
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.
setLineIncrement
public void setLineIncrement(int v)
- Note: setLineIncrement() is deprecated.
As of JDK version 1.1,
replaced by setUnitIncrement(int).
getUnitIncrement
public int getUnitIncrement()
- Gets the unit increment for this scrollbar.
getLineIncrement
public int getLineIncrement()
- Note: getLineIncrement() is deprecated.
As of JDK version 1.1,
replaced by getUnitIncrement().
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.
setPageIncrement
public void setPageIncrement(int v)
- Note: setPageIncrement() is deprecated.
As of JDK version 1.1,
replaced by setBlockIncrement().
getBlockIncrement
public int getBlockIncrement()
- Gets the block increment for this scrollbar.
getPageIncrement
public int getPageIncrement()
- Note: getPageIncrement() is deprecated.
As of JDK version 1.1,
replaced by getBlockIncrement().
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:
- The maximum must be greater than the minimum
- The value must be greater than or equal to the minumum
and less than or equal to the maximum minus the
visible amount
- The visible amount must be greater than 1 and less than or equal
to the difference between the maximum and minimum values.
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
addAdjustmentListener
public synchronized void addAdjustmentListener(AdjustmentListener l)
- Adds the specified adjustment listener to recieve adjustment events
from this scrollbar.
- Parameters:
- l - the adjustment listener
removeAdjustmentListener
public synchronized void removeAdjustmentListener(AdjustmentListener l)
- Removes the specified adjustment listener so that it no longer
receives adjustment events from this scrollbar..
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
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
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