java.awt
public class Scrollbar extends Component implements Accessible, Adjustable
Nested Class Summary | |
---|---|
protected class | Scrollbar.AccessibleAWTScrollBar
This class provides accessibility support for the
scrollbar.
|
Field Summary | |
---|---|
static int | HORIZONTAL
Constant indicating that a scrollbar is horizontal. |
static int | VERTICAL
Constant indicating that a scrollbar is vertical. |
Constructor Summary | |
---|---|
Scrollbar()
Initializes a new instance of Scrollbar with a
vertical orientation and default values for all other parameters.
| |
Scrollbar(int orientation)
Initializes a new instance of Scrollbar with the
specified orientation and default values for all other parameters.
| |
Scrollbar(int orientation, int value, int visibleAmount, int minimum, int maximum)
Initializes a new instance of Scrollbar with the
specified parameters. |
Method Summary | |
---|---|
void | addAdjustmentListener(AdjustmentListener listener)
Adds a new adjustment listener to the list of registered listeners
for this object.
|
void | addNotify()
Notifies this object to create its native peer. |
AccessibleContext | getAccessibleContext()
Gets the AccessibleContext associated with this Scrollbar .
|
AdjustmentListener[] | getAdjustmentListeners()
Returns an array of all registered adjustment listeners. |
int | getBlockIncrement()
Returns the value added or subtracted when the user activates the scrollbar
scroll by a "block" amount.
|
int | getLineIncrement()
Returns the value added or subtracted when the user selects the scrollbar
scroll by a "unit" amount control.
|
<T extends EventListener> T[] | getListeners(Class<T> listenerType)
Returns an array of all the objects currently registered as FooListeners
upon this Scrollbar . |
int | getMaximum()
Returns the maximum value for this scrollbar.
|
int | getMinimum()
Returns the minimum value for this scrollbar.
|
int | getOrientation()
Returns the orientation constant for this object.
|
int | getPageIncrement()
Returns the value added or subtracted when the user selects the scrollbar
scroll by a "block" amount control.
|
int | getUnitIncrement()
Returns the value added or subtracted when the user activates the scrollbar
scroll by a "unit" amount.
|
int | getValue()
Returns the current value for this scrollbar.
|
boolean | getValueIsAdjusting()
Returns true if the value is in the process of changing.
|
int | getVisible()
Returns the width of the scrollbar's thumb, in units relative to the
maximum and minimum value of the scrollbar.
|
int | getVisibleAmount()
Returns the width of the scrollbar's thumb, in units relative to the
maximum and minimum value of the scrollbar.
|
protected String | paramString()
Returns a debugging string for this object.
|
protected void | processAdjustmentEvent(AdjustmentEvent event)
Processes adjustment events for this object by dispatching them to
any registered listeners. |
protected void | processEvent(AWTEvent event)
Processes events for this scrollbar. |
void | removeAdjustmentListener(AdjustmentListener listener)
Removes the specified listener from the list of registered listeners
for this object.
|
void | setBlockIncrement(int blockIncrement)
Sets the value added or subtracted to the scrollbar value when the
user selects the scroll by a "block" amount control.
|
void | setLineIncrement(int lineIncrement)
Sets the value added or subtracted to the scrollbar value when the
user selects the scroll by a "unit" amount control.
|
void | setMaximum(int maximum)
Sets the maximum value for this scrollbar to the specified value.
|
void | setMinimum(int minimum)
Sets the minimum value for this scrollbar to the specified value. |
void | setOrientation(int orientation)
Sets the orientation of this scrollbar to the specified value. |
void | setPageIncrement(int pageIncrement)
Sets the value added or subtracted to the scrollbar value when the
user selects the scroll by a "block" amount control.
|
void | setUnitIncrement(int unitIncrement)
Sets the value added or subtracted to the scrollbar value when the
user selects the scroll by a "unit" amount control.
|
void | setValue(int value)
Sets the current value for this scrollbar to the specified value.
|
void | setValueIsAdjusting(boolean valueIsAdjusting)
Sets the value of valueIsAdjusting.
|
void | setValues(int value, int visibleAmount, int minimum, int maximum)
Sets the current value, visible amount, minimum, and maximum for this
scrollbar. |
void | setVisibleAmount(int visibleAmount)
Sets the width of the scrollbar's thumb, in units relative to the
maximum and minimum value of the scrollbar.
|
Scrollbar
with a
vertical orientation and default values for all other parameters.
Throws: HeadlessException If GraphicsEnvironment.isHeadless() is true,
Scrollbar
with the
specified orientation and default values for all other parameters.
The orientation must be either the constant HORIZONTAL
or
VERTICAL
from this class. An incorrect value will throw
an exception.
Parameters: orientation The orientation of this scrollbar.
Throws: HeadlessException If GraphicsEnvironment.isHeadless() is true, IllegalArgumentException If the orientation value is not valid.
Scrollbar
with the
specified parameters. The orientation must be either the constant
HORIZONTAL
or VERTICAL
. An incorrect value
will throw an exception. Inconsistent values for other parameters
are silently corrected to valid values.
Parameters: orientation The orientation of this scrollbar. value The initial value of the scrollbar. visibleAmount The width of the scrollbar thumb. minimum The minimum value of the scrollbar. maximum The maximum value of the scrollbar.
Throws: HeadlessException If GraphicsEnvironment.isHeadless() is true, IllegalArgumentException If the orientation value is not valid.
Parameters: listener The listener to add.
Scrollbar
.
The context is created, if necessary.
Returns: the associated context
Returns: The block increment value.
Deprecated: This method is deprecated in favor of
getUnitIncrement()
.
Returns: The unit increment value.
Scrollbar
. FooListeners are registered using the
addFooListener method.
Throws: ClassCastException If listenerType doesn't specify a class or interface that implements java.util.EventListener.
Returns: The maximum value for this scrollbar.
Returns: The minimum value for this scrollbar.
Returns: The orientation constant for this object.
Deprecated: This method is deprecated in favor of
getBlockIncrement()
.
Returns: The block increment value.
Returns: The unit increment value.
Returns: The current value for this scrollbar.
Since: 1.4
Deprecated: This method is deprecated in favor of
getVisibleAmount()
.
Returns: The width of the scrollbar's thumb.
Returns: The width of the scrollbar's thumb.
Returns: A debugging string for this object.
enableEvents()
.
Parameters: event The event to process.
processAdjustmentEvent()
if the event is an instance of
AdjustmentEvent
, otherwise it calls the superclass to
process the event.
Parameters: event The event to process.
Parameters: listener The listener to remove.
Parameters: blockIncrement The new block increment amount.
Deprecated: This method is deprecated in favor of
setUnitIncrement()
.
Parameters: lineIncrement The new unit increment amount.
Parameters: maximum The new maximum value for this scrollbar.
Parameters: minimum The new minimum value for this scrollbar.
HORIZONTAL
or
VERTICAL
from this class or an exception will be thrown.
Parameters: orientation The new orientation value.
Throws: IllegalArgumentException If the orientation value is not valid.
Deprecated: This method is deprecated in favor of
setBlockIncrement()
.
Parameters: pageIncrement The new block increment amount.
Parameters: unitIncrement The new unit increment amount.
Parameters: value The new value for this scrollbar.
Since: 1.4
Parameters: value The new value for this scrollbar. visibleAmount The new visible amount for this scrollbar. minimum The new minimum value for this scrollbar. maximum The new maximum value for this scrollbar.
Parameters: visibleAmount The new visible amount value of the scrollbar.