|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object![]()
![]()
![]()
java.awt.Component
![]()
![]()
![]()
java.awt.Container
![]()
![]()
![]()
javax.swing.JComponent
![]()
![]()
![]()
javax.swing.JScrollBar
, ImageObserver
, MenuContainer
, Serializable
, Accessible


public class JScrollBar

, Accessible

An implementation of a scrollbar. The user positions the knob in the scrollbar to determine the contents of the viewing area. The program typically adjusts the display so that the end of the scrollbar represents the end of the displayable contents, or 100% of the contents. The start of the scrollbar is the beginning of the displayable contents, or 0%. The position of the knob within those bounds then translates to the corresponding percentage of the displayable contents.
Typically, as the position of the knob in the scrollbar changes a corresponding change is made to the position of the JViewport on the underlying view, changing the contents of the JViewport.
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeansTM
has been added to the java.beans package.
Please see XMLEncoder
.
JScrollPane
,
Serialized Form| Nested Class Summary | |
|---|---|
protected class |
JScrollBar.AccessibleJScrollBar
This class implements accessibility support for the JScrollBar class. |
Nested classes/interfaces inherited from class javax.swing.JComponent ![]() |
|---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container ![]() |
|---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component ![]() |
|---|
Component.AccessibleAWTComponent |
| Field Summary | |
|---|---|
protected int |
blockIncrement
|
protected BoundedRangeModel |
model
The model that represents the scrollbar's minimum, maximum, extent (aka "visibleAmount") and current value. |
protected int |
orientation
|
protected int |
unitIncrement
|
Fields inherited from class javax.swing.JComponent ![]() |
|---|
accessibleContext |
Fields inherited from class java.awt.Component ![]() |
|---|
BOTTOM_ALIGNMENT |
Fields inherited from interface java.awt.Adjustable ![]() |
|---|
HORIZONTAL |
Fields inherited from interface java.awt.image.ImageObserver ![]() |
|---|
ABORT |
| Constructor Summary | |
|---|---|
JScrollBar
Creates a vertical scrollbar with the following initial values: |
|
JScrollBar
Creates a scrollbar with the specified orientation and the following initial values: |
|
JScrollBar
Creates a scrollbar with the specified orientation, value, extent, minimum, and maximum. |
|
| Method Summary | |
|---|---|
void |
addAdjustmentListener
Adds an AdjustmentListener. |
protected void |
fireAdjustmentValueChanged
|
AccessibleContext |
getAccessibleContext
Gets the AccessibleContext associated with this JScrollBar. |
AdjustmentListener |
getAdjustmentListeners
Returns an array of all the AdjustmentListeners added
to this JScrollBar with addAdjustmentListener(). |
int |
getBlockIncrement
For backwards compatibility with java.awt.Scrollbar. |
int |
getBlockIncrement
Returns the amount to change the scrollbar's value by, given a block (usually "page") up/down request. |
int |
getMaximum
The maximum value of the scrollbar is maximum - extent. |
Dimension |
getMaximumSize
The scrollbar is flexible along it's scrolling axis and rigid along the other axis. |
int |
getMinimum
Returns the minimum value supported by the scrollbar (usually zero). |
Dimension |
getMinimumSize
The scrollbar is flexible along it's scrolling axis and rigid along the other axis. |
BoundedRangeModel |
getModel
Returns data model that handles the scrollbar's four fundamental properties: minimum, maximum, value, extent. |
int |
getOrientation
Returns the component's orientation (horizontal or vertical). |
ScrollBarUI |
getUI
Returns the delegate that implements the look and feel for this component. |
String |
getUIClassID
Returns the name of the LookAndFeel class for this component. |
int |
getUnitIncrement
For backwards compatibility with java.awt.Scrollbar. |
int |
getUnitIncrement
Returns the amount to change the scrollbar's value by, given a unit up/down request. |
int |
getValue
Returns the scrollbar's value. |
boolean |
getValueIsAdjusting
True if the scrollbar knob is being dragged. |
int |
getVisibleAmount
Returns the scrollbar's extent, aka its "visibleAmount". |
protected String |
paramString
Returns a string representation of this JScrollBar. |
void |
removeAdjustmentListener
Removes an AdjustmentEvent listener. |
void |
setBlockIncrement
Sets the blockIncrement property. |
void |
setEnabled
Enables the component so that the knob position can be changed. |
void |
setMaximum
Sets the model's maximum property. |
void |
setMinimum
Sets the model's minimum property. |
void |
setModel
Sets the model that handles the scrollbar's four fundamental properties: minimum, maximum, value, extent. |
void |
setOrientation
Set the scrollbar's orientation to either VERTICAL or HORIZONTAL. |
void |
setUI
Sets the L&F object that renders this component. |
void |
setUnitIncrement
Sets the unitIncrement property. |
void |
setValue
Sets the scrollbar's value. |
void |
setValueIsAdjusting
Sets the model's valueIsAdjusting property. |
void |
setValues
Sets the four BoundedRangeModel properties after forcing the arguments to obey the usual constraints: |
void |
setVisibleAmount
Set the model's extent property. |
void |
updateUI
Overrides JComponent.updateUI. |