Adjustable (Java SE 19 & JDK 19) (original) (raw)
All Known Implementing Classes:
[JScrollBar](../../javax/swing/JScrollBar.html "class in javax.swing")
, [JScrollPane.ScrollBar](../../javax/swing/JScrollPane.ScrollBar.html "class in javax.swing")
, [Scrollbar](Scrollbar.html "class in java.awt")
, [ScrollPaneAdjustable](ScrollPaneAdjustable.html "class in java.awt")
public interface Adjustable
The interface for objects which have an adjustable numeric value contained within a bounded range of values.
Field Summary
Fieldsstatic final int
Indicates that the Adjustable
has horizontal orientation.static final int
Indicates that the Adjustable
has no orientation.static final int
Indicates that the Adjustable
has vertical orientation.
Method Summary
void
Adds a listener to receive adjustment events when the value of the adjustable object changes.int
Gets the block value increment for the adjustable object.int
Gets the maximum value of the adjustable object.int
Gets the minimum value of the adjustable object.int
Gets the orientation of the adjustable object.int
Gets the unit value increment for the adjustable object.int
[getValue](#getValue%28%29)()
Gets the current value of the adjustable object.int
Gets the length of the proportional indicator.void
Removes an adjustment listener.void
[setBlockIncrement](#setBlockIncrement%28int%29)(int b)
Sets the block value increment for the adjustable object.void
[setMaximum](#setMaximum%28int%29)(int max)
Sets the maximum value of the adjustable object.void
[setMinimum](#setMinimum%28int%29)(int min)
Sets the minimum value of the adjustable object.void
[setUnitIncrement](#setUnitIncrement%28int%29)(int u)
Sets the unit value increment for the adjustable object.void
[setValue](#setValue%28int%29)(int v)
Sets the current value of the adjustable object.void
[setVisibleAmount](#setVisibleAmount%28int%29)(int v)
Sets the length of the proportional indicator of the adjustable object.
Field Details
HORIZONTAL
@Native static final int HORIZONTAL
Indicates that theAdjustable
has horizontal orientation.
See Also:
* Constant Field ValuesVERTICAL
@Native static final int VERTICAL
Indicates that theAdjustable
has vertical orientation.
See Also:
* Constant Field ValuesNO_ORIENTATION
@Native static final int NO_ORIENTATION
Indicates that theAdjustable
has no orientation.
See Also:
* Constant Field ValuesMethod Details
getOrientation
int getOrientation()
Gets the orientation of the adjustable object.
Returns:
the orientation of the adjustable object; eitherHORIZONTAL
,VERTICAL
, orNO_ORIENTATION
setMinimum
void setMinimum(int min)
Sets the minimum value of the adjustable object.
Parameters:
min
- the minimum valuegetMinimum
int getMinimum()
Gets the minimum value of the adjustable object.
Returns:
the minimum value of the adjustable objectsetMaximum
void setMaximum(int max)
Sets the maximum value of the adjustable object.
Parameters:
max
- the maximum valuegetMaximum
int getMaximum()
Gets the maximum value of the adjustable object.
Returns:
the maximum value of the adjustable objectsetUnitIncrement
void setUnitIncrement(int u)
Sets the unit value increment for the adjustable object.
Parameters:
u
- the unit incrementgetUnitIncrement
int getUnitIncrement()
Gets the unit value increment for the adjustable object.
Returns:
the unit value increment for the adjustable objectsetBlockIncrement
void setBlockIncrement(int b)
Sets the block value increment for the adjustable object.
Parameters:
b
- the block incrementgetBlockIncrement
int getBlockIncrement()
Gets the block value increment for the adjustable object.
Returns:
the block value increment for the adjustable objectsetVisibleAmount
void setVisibleAmount(int v)
Sets the length of the proportional indicator of the adjustable object.
Parameters:
v
- the length of the indicatorgetVisibleAmount
int getVisibleAmount()
Gets the length of the proportional indicator.
Returns:
the length of the proportional indicatorsetValue
void setValue(int v)
Sets the current value of the adjustable object. If the value supplied is less thanminimum
or greater thanmaximum
-visibleAmount
, then one of those values is substituted, as appropriate.
Calling this method does not fire anAdjustmentEvent
.
Parameters:
v
- the current value, betweenminimum
andmaximum
-visibleAmount
getValue
int getValue()
Gets the current value of the adjustable object.
Returns:
the current value of the adjustable objectaddAdjustmentListener
Adds a listener to receive adjustment events when the value of the adjustable object changes.
Parameters:
l
- the listener to receive events
See Also:
* AdjustmentEventremoveAdjustmentListener
Removes an adjustment listener.
Parameters:
l
- the listener being removed
See Also:
* AdjustmentEvent