The Scrollbar is a Component that provides the means to get and set values within a predetermined range. For example, a scrollbar could be used for a volume control. Scrollbars are most frequently used to help users manipulate areas too large to be displayed on the screen (pre version 1.1) or to set a value within an integer range.
public class java.awt.Scrollbar extends java.awt.Component implements java.awt.Adjustable { // Constants public final static int HORIZONTAL; public final static int VERTICAL; // Constructors public Scrollbar(); public Scrollbar (int orientation); public Scrollbar (int orientation, int value, int visible, int minimum, int maximum); // Instance Methods public void addAdjustmentListener (AdjustmentListener l); public void addNotify(); public int getBlockIncrement(); public int getLineIncrement(); public int getMaximum(); public int getMinimum(); public int getOrientation(); public int getPageIncrement(); public int getUnitIncrement(); public int getValue(); public int getVisible(); public int getVisibleAmount(); public void removeAdjustmentListener (AdjustmentListener l); public synchronized void setBlockIncrement (int v); public void setLineIncrement (int amount); public synchronized void setMaximum (int newMaximum); public synchronized void setMinimum (int newMinimum); public synchronized void setOrientation (int orientation); public void setPageIncrement (int amount); public synchronized void setUnitIncrement(int v); public synchronized void setValue (int value); public synchronized void setValues (int value, int visible, int minimum, int maximum); public synchronized void setVisibleAmount (int newAmount); // Protected Instance Methods protected String paramString(); protected void processAdjustmentEvent (AdjustmentEvent e); protected void processEvent (AWTEvent e); }
Constant used for a Scrollbar with a horizontal orientation.
Constant used for a Scrollbar with a vertical orientation.
Constructs a vertical Scrollbar object; slider size, minimum value, maximum value, and initial value are all zero.
Scrollbar constant designating direction.
If orientation is invalid.
Constructs a Scrollbar object, in the designated direction; slider size, minimum value, maximum value, and initial value are all zero.
Scrollbar constant designating direction.
Initial value of Scrollbar.
Initial slider size.
Initial minimum value.
Initial maximum value.
If orientation is invalid.
Constructs a Scrollbar object with the given values.
An object that implements the AdjustmentListener interface.
Adjustable.addAdjustmentListener()
Add a listener for adjustment event.
Component.addNotify()
Creates Scrollbar's peer.
Adjustable.getBlockIncrement()
The amount to scroll when a paging area is selected.
The amount to scroll when one of the arrows at the ends of the scrollbar is selected. Replaced by getUnitIncrement().
Adjustable.getMaximum()
The maximum value that the Scrollbar can take.
Adjustable.getMinimum()
The minimum value that the Scrollbar can take.
Adjustable.getOrientation()
A constant representing the direction of the Scrollbar.
The amount to scroll when a paging area is selected. Replaced with getBlockIncrement().
Adjustable.getUnitIncrement()
The amount to scroll when one of the arrows at the ends of the scrollbar is selected.
Adjustable.getValue()
The current setting for the Scrollbar.
The current visible setting (i.e., size) for the slider. Replaced by getVisibleAmount().
Adjustable.getVisibleAmount()
The current visible setting (i.e., size) for the slider.
One of this Scrollbar's AdjustmentListeners.
Adjustable.removeAdjustmentListener()
Remove an adjustment event listener.
New paging increment amount.
Adjustable.setBlockIncrement()
Changes the block increment amount for the Scrollbar; the default block increment is 10.
New line increment amount.
Changes the line increment amount for the Scrollbar. The default line increment is 1. Replaced by setUnitIncrement(int).
New maximum value.
Adjustable.setMaximum()
Changes the maximum value for the Scrollbar.
New minimum value.
Adjustable.setMinimum()
Changes the minimum value for the Scrollbar.
One of the orientation constants HORIZONTAL or VERTICAL.
Changes the orientation of the Scrollbar.
New paging increment amount.
Changes the paging increment amount for the Scrollbar; the default page increment is 10. Replaced by setBlockIncrement(int).
New line increment amount.
Adjustable.setUnitIncrement()
Changes the unit increment amount for the Scrollbar. The default unit increment is 1.
New Scrollbar value.
Adjustable.setValue()
Changes the current value of the Scrollbar.
New Scrollbar value.
New slider width.
New minimum value for Scrollbar.
New maximum value for Scrollbar.
Changes the settings of the Scrollbar to the given amounts.
New amount visible.
Adjustable.setVisibleAmount()
Changes the current visible amount of the Scrollbar.
String with current settings of Scrollbar.
Component.paramString()
Helper method for toString() to generate string of current settings.
The adjustment event to process.
Adjustment events are passed to this method for processing. Normally, this method is called by processEvent().
The event to process.
Low level AWTEvents are passed to this method for processing.
Adjustable, Component, String