javax.swing
public class JScrollBar extends JComponent implements Adjustable, Accessible
Nested Class Summary | |
---|---|
protected class | JScrollBar.AccessibleJScrollBar
Provides the accessibility features for the JScrollBar
component. |
Field Summary | |
---|---|
protected int | blockIncrement How much the thumb moves when moving in a block. |
protected BoundedRangeModel | model The model that holds the scroll bar's data. |
protected int | orientation The orientation of the scroll bar. |
protected int | unitIncrement How much the thumb moves when moving in a unit. |
Constructor Summary | |
---|---|
JScrollBar()
Creates a new horizontal JScrollBar object with a minimum
of 0, a maxmium of 100, a value of 0 and an extent of 10. | |
JScrollBar(int orientation)
Creates a new JScrollBar object with a minimum of 0, a
maximum of 100, a value of 0, an extent of 10 and the given
orientation.
| |
JScrollBar(int orientation, int value, int extent, int min, int max)
Creates a new JScrollBar object with the given orientation,
value, min, max, and extent.
|
Method Summary | |
---|---|
void | addAdjustmentListener(AdjustmentListener listener)
This method adds an AdjustmentListener to the scroll bar.
|
protected void | fireAdjustmentValueChanged(int id, int type, int value)
This method is called to fired AdjustmentEvents to the listeners
of this scroll bar. |
AccessibleContext | getAccessibleContext()
Returns the object that provides accessibility features for this
JScrollBar component.
|
AdjustmentListener[] | getAdjustmentListeners()
This method returns an arry of all AdjustmentListeners listening to
this scroll bar.
|
int | getBlockIncrement(int direction)
The method returns how much the scrollbar's value
should change for a block increment depending on
the given direction.
|
int | getBlockIncrement()
This method returns the blockIncrement.
|
int | getMaximum()
This method returns the maximum value of the scrollbar.
|
Dimension | getMaximumSize()
This method returns the maximum size for this scroll bar.
|
int | getMinimum()
This method returns the minimum value of the scrollbar.
|
Dimension | getMinimumSize()
This method returns the minimum size for this scroll bar.
|
BoundedRangeModel | getModel()
This method returns the model being used with
the scrollbar.
|
int | getOrientation()
This method returns the orientation of the scrollbar.
|
ScrollBarUI | getUI()
This method returns the UI that is being used
with this scrollbar.
|
String | getUIClassID()
This method returns an identifier to
choose the correct UI delegate for the
scrollbar.
|
int | getUnitIncrement(int direction)
This method returns how much the scrollbar's value
should change for a unit increment depending on the
given direction.
|
int | getUnitIncrement()
This method returns the unitIncrement.
|
int | getValue()
This method returns the value of the scrollbar.
|
boolean | getValueIsAdjusting()
This method returns the model's isAjusting value.
|
int | getVisibleAmount()
This method returns the visible amount (AKA extent).
|
protected String | paramString()
Returns a string describing the attributes for the JScrollBar
component, for use in debugging. |
void | removeAdjustmentListener(AdjustmentListener listener)
This method removes an AdjustmentListener from the scroll bar.
|
void | setBlockIncrement(int blockIncrement)
This method sets the blockIncrement property.
|
void | setEnabled(boolean x)
This method overrides the setEnabled in JComponent.
|
void | setMaximum(int maximum)
This method sets the maximum value of the scrollbar.
|
void | setMinimum(int minimum)
This method sets the minimum value of the scrollbar.
|
void | setModel(BoundedRangeModel newModel)
This method sets the model to use with
the scrollbar.
|
void | setOrientation(int orientation)
This method sets the orientation of the scrollbar.
|
void | setUI(ScrollBarUI ui)
This method sets the UI of this scrollbar to
the given UI.
|
void | setUnitIncrement(int unitIncrement)
This method sets the unitIncrement property.
|
void | setValue(int value)
This method changes the value of the scrollbar.
|
void | setValueIsAdjusting(boolean b)
This method sets the model's isAdjusting value.
|
void | setValues(int newValue, int newExtent, int newMin, int newMax)
This method sets the value, extent, minimum and
maximum.
|
void | setVisibleAmount(int extent)
This method sets the visible amount (AKA extent).
|
void | updateUI()
This method changes the UI to be the
default for the current look and feel. |
Parameters: orientation The orientation of the JScrollBar.
Parameters: orientation The orientation to use. value The value to use. extent The extent to use. min The minimum value of the scrollbar. max The maximum value of the scrollbar.
Parameters: listener The listener to add.
Parameters: id The ID of the adjustment event. type The Type of change. value The new value for the property that was changed..
JScrollBar
component.
Returns: The accessible context (an instance of {@link AccessibleJScrollBar}).
Returns: An array of AdjustmentListeners listening to this scroll bar.
Parameters: direction The direction to scroll in.
Returns: The amount the scrollbar's value will change given the direction.
Returns: The blockIncrement.
Returns: The maximum value of the scrollbar.
Returns: The maximum size.
Returns: The minimum value of the scrollbar.
Returns: The minimum size.
Returns: The scrollbar's model.
Returns: The orientation of the scrollbar.
Returns: The scrollbar's current UI.
Returns: The identifer to choose the UI delegate; "ScrollBarUI"
Parameters: direction The direction to scroll in.
Returns: The amount the scrollbar's value will change given the direction.
Returns: The unitIncrement.
Returns: The value of the scrollbar.
Returns: The model's isAdjusting value.
Returns: The visible amount (AKA extent).
JScrollBar
component, for use in debugging. The return value is guaranteed to be
non-null
, but the format of the string may vary between
implementations.
Returns: A string describing the attributes of the JScrollBar
.
Parameters: listener The listener to remove.
Parameters: blockIncrement The new blockIncrement.
Parameters: x Whether the scrollbar is enabled.
Parameters: maximum The maximum value of the scrollbar.
Parameters: minimum The minimum value of the scrollbar.
Parameters: newModel The new model to use with the scrollbar.
Parameters: orientation The orientation of the scrollbar.
Parameters: ui The UI to use with this scrollbar.
Parameters: unitIncrement The new unitIncrement.
Parameters: value The new value of the scrollbar.
Parameters: b The new isAdjusting value.
Parameters: newValue The new value. newExtent The new extent. newMin The new minimum. newMax The new maximum.
Parameters: extent The visible amount (AKA extent).