Class ScrollPaneAdjustable
java.lang.Object
java.awt.ScrollPaneAdjustable
- All Implemented Interfaces:
Adjustable, Serializable
public final class ScrollPaneAdjustable extends Object implements Adjustable, Serializable
This class represents the state of a horizontal or vertical scrollbar of a
ScrollPane. Objects of this class are returned by ScrollPane methods.- Since:
- 1.4
- See Also:
Field Summary
Fields declared in interface Adjustable
HORIZONTAL, NO_ORIENTATION, VERTICAL | Modifier and Type | Field | Description |
|---|---|---|
static final int |
HORIZONTAL |
Indicates that the Adjustable has horizontal orientation. |
static final int |
NO_ORIENTATION |
Indicates that the Adjustable has no orientation. |
static final int |
VERTICAL |
Indicates that the Adjustable has vertical orientation. |
Method Summary
| Modifier and Type | Method | Description |
|---|---|---|
void |
addAdjustmentListener |
Adds the specified adjustment listener to receive adjustment events from this ScrollPaneAdjustable. |
AdjustmentListener[] |
getAdjustmentListeners() |
Returns an array of all the adjustment listeners registered on this ScrollPaneAdjustable. |
int |
getBlockIncrement() |
Gets the block value increment for the adjustable object. |
int |
getMaximum() |
Gets the maximum value of the adjustable object. |
int |
getMinimum() |
Gets the minimum value of the adjustable object. |
int |
getOrientation() |
Returns the orientation of this scrollbar. |
int |
getUnitIncrement() |
Gets the unit value increment for the adjustable object. |
int |
getValue() |
Gets the current value of the adjustable object. |
boolean |
getValueIsAdjusting() |
Returns true if the value is in the process of changing as a result of actions being taken by the user. |
int |
getVisibleAmount() |
Gets the length of the proportional indicator. |
String |
paramString() |
Returns a string representing the state of this scrollbar. |
void |
removeAdjustmentListener |
Removes the specified adjustment listener so that it no longer receives adjustment events from this ScrollPaneAdjustable. |
void |
setBlockIncrement |
Sets the block value increment for the adjustable object. |
void |
setMaximum |
This method should NOT be called by user code. |
void |
setMinimum |
This method should NOT be called by user code. |
void |
setUnitIncrement |
Sets the unit value increment for the adjustable object. |
void |
setValue |
Sets the value of this scrollbar to the specified value. |
void |
setValueIsAdjusting |
Sets the valueIsAdjusting property. |
void |
setVisibleAmount |
This method should NOT be called by user code. |
String |
toString() |
Returns a string representation of this scrollbar and its values. |
Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | Modifier and Type | Method | Description |
|---|---|---|
protected Object |
clone() |
Creates and returns a copy of this object. |
boolean |
equals |
Indicates whether some other object is "equal to" this one. |
protected void |
finalize() |
Deprecated, for removal: This API element is subject to removal in a future version. Finalization is deprecated and subject to removal in a future release. |
final Class |
getClass() |
Returns the runtime class of this Object. |
int |
hashCode() |
Returns a hash code value for this object. |
final void |
notify() |
Wakes up a single thread that is waiting on this object's monitor. |
final void |
notifyAll() |
Wakes up all threads that are waiting on this object's monitor. |
final void |
wait() |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
final void |
wait |
Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed. |
Method Details
getOrientation
public int getOrientation()
Returns the orientation of this scrollbar.
- Specified by:
-
getOrientationin interfaceAdjustable - Returns:
- the orientation of this scrollbar, either
Adjustable.HORIZONTALorAdjustable.VERTICAL
setMinimum
public void setMinimum(int min)
This method should NOT be called by user code. This method is public for this class to properly implement
Adjustable interface.- Specified by:
-
setMinimumin interfaceAdjustable - Parameters:
-
min- the minimum value - Throws:
-
AWTError- Always throws an error when called.
getMinimum
public int getMinimum()
Description copied from interface:
AdjustableGets the minimum value of the adjustable object.
- Specified by:
-
getMinimumin interfaceAdjustable - Returns:
- the minimum value of the adjustable object
setMaximum
public void setMaximum(int max)
This method should NOT be called by user code. This method is public for this class to properly implement
Adjustable interface.- Specified by:
-
setMaximumin interfaceAdjustable - Parameters:
-
max- the maximum value - Throws:
-
AWTError- Always throws an error when called.
getMaximum
public int getMaximum()
Description copied from interface:
AdjustableGets the maximum value of the adjustable object.
- Specified by:
-
getMaximumin interfaceAdjustable - Returns:
- the maximum value of the adjustable object
setUnitIncrement
public void setUnitIncrement(int u)
Description copied from interface:
AdjustableSets the unit value increment for the adjustable object.
- Specified by:
-
setUnitIncrementin interfaceAdjustable - Parameters:
-
u- the unit increment
getUnitIncrement
public int getUnitIncrement()
Description copied from interface:
AdjustableGets the unit value increment for the adjustable object.
- Specified by:
-
getUnitIncrementin interfaceAdjustable - Returns:
- the unit value increment for the adjustable object
setBlockIncrement
public void setBlockIncrement(int b)
Description copied from interface:
AdjustableSets the block value increment for the adjustable object.
- Specified by:
-
setBlockIncrementin interfaceAdjustable - Parameters:
-
b- the block increment
getBlockIncrement
public int getBlockIncrement()
Description copied from interface:
AdjustableGets the block value increment for the adjustable object.
- Specified by:
-
getBlockIncrementin interfaceAdjustable - Returns:
- the block value increment for the adjustable object
setVisibleAmount
public void setVisibleAmount(int v)
This method should NOT be called by user code. This method is public for this class to properly implement
Adjustable interface.- Specified by:
-
setVisibleAmountin interfaceAdjustable - Parameters:
-
v- the length of the indicator - Throws:
-
AWTError- Always throws an error when called.
getVisibleAmount
public int getVisibleAmount()
Description copied from interface:
AdjustableGets the length of the proportional indicator.
- Specified by:
-
getVisibleAmountin interfaceAdjustable - Returns:
- the length of the proportional indicator
setValueIsAdjusting
public void setValueIsAdjusting(boolean b)
Sets the
valueIsAdjusting property.- Parameters:
-
b- new adjustment-in-progress status - Since:
- 1.4
- See Also:
getValueIsAdjusting
public boolean getValueIsAdjusting()
Returns true if the value is in the process of changing as a result of actions being taken by the user.
- Returns:
- the value of the
valueIsAdjustingproperty - See Also:
setValue
public void setValue(int v)
Sets the value of this scrollbar to the specified value.
If the value supplied is less than the current minimum or greater than the current maximum, then one of those values is substituted, as appropriate.
- Specified by:
-
setValuein interfaceAdjustable - Parameters:
-
v- the new value of the scrollbar
getValue
public int getValue()
Description copied from interface:
AdjustableGets the current value of the adjustable object.
- Specified by:
-
getValuein interfaceAdjustable - Returns:
- the current value of the adjustable object
addAdjustmentListener
public void addAdjustmentListener(AdjustmentListener l)
Adds the specified adjustment listener to receive adjustment events from this
ScrollPaneAdjustable. If l is null, no exception is thrown and no action is performed. Refer to AWT Threading Issues for details on AWT's threading model.
- Specified by:
-
addAdjustmentListenerin interfaceAdjustable - Parameters:
-
l- the adjustment listener. - See Also:
removeAdjustmentListener
public void removeAdjustmentListener(AdjustmentListener l)
Removes the specified adjustment listener so that it no longer receives adjustment events from this
ScrollPaneAdjustable. If l is null, no exception is thrown and no action is performed. Refer to AWT Threading Issues for details on AWT's threading model.
- Specified by:
-
removeAdjustmentListenerin interfaceAdjustable - Parameters:
-
l- the adjustment listener. - Since:
- 1.1
- See Also:
getAdjustmentListeners
public AdjustmentListener[] getAdjustmentListeners()
Returns an array of all the adjustment listeners registered on this
ScrollPaneAdjustable.- Returns:
- all of this
ScrollPaneAdjustable'sAdjustmentListeners or an empty array if no adjustment listeners are currently registered - Since:
- 1.4
- See Also:
toString
paramString
public String paramString()
Returns a string representing the state of this scrollbar. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be
null.- Returns:
- the parameter string of this scrollbar.
© 1993, 2025, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.