Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JScrollBar
Nested Class Summary | |
protected 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 , Component.BltBufferStrategy , Component.FlipBufferStrategy |
Field Summary | |
protected int |
|
protected BoundedRangeModel |
|
protected int |
|
protected int |
|
Fields inherited from class javax.swing.JComponent | |
TOOL_TIP_TEXT_KEY , UNDEFINED_CONDITION , WHEN_ANCESTOR_OF_FOCUSED_COMPONENT , WHEN_FOCUSED , WHEN_IN_FOCUSED_WINDOW , accessibleContext , listenerList , ui |
Fields inherited from class java.awt.Component | |
BOTTOM_ALIGNMENT , CENTER_ALIGNMENT , LEFT_ALIGNMENT , RIGHT_ALIGNMENT , TOP_ALIGNMENT |
Fields inherited from interface java.awt.Adjustable | |
HORIZONTAL , NO_ORIENTATION , VERTICAL |
Fields inherited from interface java.awt.image.ImageObserver | |
ABORT , ALLBITS , ERROR , FRAMEBITS , HEIGHT , PROPERTIES , SOMEBITS , WIDTH |
Constructor Summary | |
| |
| |
|
Method Summary | |
void |
|
protected void |
|
AccessibleContext |
|
AdjustmentListener[] |
|
int |
|
int |
|
int |
|
Dimension |
|
int |
|
Dimension |
|
BoundedRangeModel |
|
int |
|
ScrollBarUI |
|
String |
|
int |
|
int |
|
int |
|
boolean |
|
int |
|
protected String |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public 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.
public 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.
- Parameters:
orientation
- The orientation of the JScrollBar.
public 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.
- 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.
public void addAdjustmentListener(AdjustmentListener listener)
This method adds an AdjustmentListener to the scroll bar.
- Specified by:
- addAdjustmentListener in interface Adjustable
- Parameters:
listener
- The listener to add.
protected void fireAdjustmentValueChanged(int id, int type, int value)
This method is called to fired AdjustmentEvents to the listeners of this scroll bar. All AdjustmentEvents that are fired will have an ID of ADJUSTMENT_VALUE_CHANGED and a type of TRACK.
- Parameters:
id
- The ID of the adjustment event.type
- The Type of change.value
- The new value for the property that was changed..
public AccessibleContext getAccessibleContext()
Returns the object that provides accessibility features for thisJScrollBar
component.
- Specified by:
- getAccessibleContext in interface Accessible
- Overrides:
- getAccessibleContext in interface JComponent
- Returns:
- The accessible context (an instance of
JScrollBar.AccessibleJScrollBar
).
public AdjustmentListener[] getAdjustmentListeners()
This method returns an arry of all AdjustmentListeners listening to this scroll bar.
- Returns:
- An array of AdjustmentListeners listening to this scroll bar.
public int getBlockIncrement()
This method returns the blockIncrement.
- Specified by:
- getBlockIncrement in interface Adjustable
- Returns:
- The blockIncrement.
public int getBlockIncrement(int direction)
The method returns how much the scrollbar's value should change for a block increment depending on the given direction.
- Parameters:
direction
- The direction to scroll in.
- Returns:
- The amount the scrollbar's value will change given the direction.
public int getMaximum()
This method returns the maximum value of the scrollbar.
- Specified by:
- getMaximum in interface Adjustable
- Returns:
- The maximum value of the scrollbar.
public Dimension getMaximumSize()
This method returns the maximum size for this scroll bar.
- Overrides:
- getMaximumSize in interface JComponent
- Returns:
- The maximum size.
public int getMinimum()
This method returns the minimum value of the scrollbar.
- Specified by:
- getMinimum in interface Adjustable
- Returns:
- The minimum value of the scrollbar.
public Dimension getMinimumSize()
This method returns the minimum size for this scroll bar.
- Overrides:
- getMinimumSize in interface JComponent
- Returns:
- The minimum size.
public BoundedRangeModel getModel()
This method returns the model being used with the scrollbar.
- Returns:
- The scrollbar's model.
public int getOrientation()
This method returns the orientation of the scrollbar.
- Specified by:
- getOrientation in interface Adjustable
- Returns:
- The orientation of the scrollbar.
public ScrollBarUI getUI()
This method returns the UI that is being used with this scrollbar.
- Returns:
- The scrollbar's current UI.
public String getUIClassID()
This method returns an identifier to choose the correct UI delegate for the scrollbar.
- Overrides:
- getUIClassID in interface JComponent
- Returns:
- The identifer to choose the UI delegate; "ScrollBarUI"
public int getUnitIncrement()
This method returns the unitIncrement.
- Specified by:
- getUnitIncrement in interface Adjustable
- Returns:
- The unitIncrement.
public int getUnitIncrement(int direction)
This method returns how much the scrollbar's value should change for a unit increment depending on the given direction.
- Parameters:
direction
- The direction to scroll in.
- Returns:
- The amount the scrollbar's value will change given the direction.
public int getValue()
This method returns the value of the scrollbar.
- Specified by:
- getValue in interface Adjustable
- Returns:
- The value of the scrollbar.
public boolean getValueIsAdjusting()
This method returns the model's isAjusting value.
- Returns:
- The model's isAdjusting value.
public int getVisibleAmount()
This method returns the visible amount (AKA extent). The visible amount can be used by UI delegates to determine the size of the thumb.
- Specified by:
- getVisibleAmount in interface Adjustable
- Returns:
- The visible amount (AKA extent).
protected String paramString()
Returns a string describing the attributes for theJScrollBar
component, for use in debugging. The return value is guaranteed to be non-null
, but the format of the string may vary between implementations.
- Overrides:
- paramString in interface JComponent
- Returns:
- A string describing the attributes of the
JScrollBar
.
public void removeAdjustmentListener(AdjustmentListener listener)
This method removes an AdjustmentListener from the scroll bar.
- Specified by:
- removeAdjustmentListener in interface Adjustable
- Parameters:
listener
- The listener to remove.
public void setBlockIncrement(int blockIncrement)
This method sets the blockIncrement property.
- Specified by:
- setBlockIncrement in interface Adjustable
- Parameters:
blockIncrement
- The new blockIncrement.
public void setEnabled(boolean x)
This method overrides the setEnabled in JComponent. When the scroll bar is disabled, the knob cannot be moved.
- Overrides:
- setEnabled in interface JComponent
- Parameters:
x
- Whether the scrollbar is enabled.
public void setMaximum(int maximum)
This method sets the maximum value of the scrollbar.
- Specified by:
- setMaximum in interface Adjustable
- Parameters:
maximum
- The maximum value of the scrollbar.
public void setMinimum(int minimum)
This method sets the minimum value of the scrollbar.
- Specified by:
- setMinimum in interface Adjustable
- Parameters:
minimum
- The minimum value of the scrollbar.
public void setModel(BoundedRangeModel newModel)
This method sets the model to use with the scrollbar.
- Parameters:
newModel
- The new model to use with the scrollbar.
public void setOrientation(int orientation)
This method sets the orientation of the scrollbar.
- Parameters:
orientation
- The orientation of the scrollbar.
public void setUI(ScrollBarUI ui)
This method sets the UI of this scrollbar to the given UI.
- Parameters:
ui
- The UI to use with this scrollbar.
public void setUnitIncrement(int unitIncrement)
This method sets the unitIncrement property.
- Specified by:
- setUnitIncrement in interface Adjustable
- Parameters:
unitIncrement
- The new unitIncrement.
public void setValue(int value)
This method changes the value of the scrollbar.
- Specified by:
- setValue in interface Adjustable
- Parameters:
value
- The new value of the scrollbar.
public void setValueIsAdjusting(boolean b)
This method sets the model's isAdjusting value.
- Parameters:
b
- The new isAdjusting value.
public void setValues(int newValue, int newExtent, int newMin, int newMax)
This method sets the value, extent, minimum and maximum.
- Parameters:
newValue
- The new value.newExtent
- The new extent.newMin
- The new minimum.newMax
- The new maximum.
public void setVisibleAmount(int extent)
This method sets the visible amount (AKA extent).
- Specified by:
- setVisibleAmount in interface Adjustable
- Parameters:
extent
- The visible amount (AKA extent).
public void updateUI()
This method changes the UI to be the default for the current look and feel.
- Overrides:
- updateUI in interface JComponent