|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JScrollBar
public class JScrollBar
The JScrollBar. Two buttons control how the values that the scroll bar can take. You can also drag the thumb or click the track to move the scroll bar. Typically, the JScrollBar is used with other components to translate the value of the bar to the viewable contents of the other components.
Nested Class Summary | |
---|---|
protected class |
JScrollBar.AccessibleJScrollBar
Provides the accessibility features for the JScrollBar
component. |
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 |
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. |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
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 | |
---|---|
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()
This method returns the blockIncrement. |
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 |
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()
This method returns the unitIncrement. |
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 |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int blockIncrement
protected BoundedRangeModel model
protected int orientation
protected int unitIncrement
Constructor Detail |
---|
public JScrollBar()
public JScrollBar(int orientation)
orientation
- The orientation of the JScrollBar.public JScrollBar(int orientation, int value, int extent, int min, int max)
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.Method Detail |
---|
public void setUI(ScrollBarUI ui)
ui
- The UI to use with this scrollbar.public ScrollBarUI getUI()
public void updateUI()
updateUI
in class JComponent
public String getUIClassID()
getUIClassID
in class JComponent
JComponent.setUI(javax.swing.plaf.ComponentUI)
,
JComponent.updateUI()
public int getOrientation()
getOrientation
in interface Adjustable
Adjustable.HORIZONTAL
,
Adjustable.VERTICAL
,
Adjustable.NO_ORIENTATION
public void setOrientation(int orientation)
orientation
- The orientation of the scrollbar.public BoundedRangeModel getModel()
public void setModel(BoundedRangeModel newModel)
newModel
- The new model to use with the scrollbar.public int getUnitIncrement(int direction)
direction
- The direction to scroll in.
public void setUnitIncrement(int unitIncrement)
setUnitIncrement
in interface Adjustable
unitIncrement
- The new unitIncrement.public int getBlockIncrement(int direction)
direction
- The direction to scroll in.
public void setBlockIncrement(int blockIncrement)
setBlockIncrement
in interface Adjustable
blockIncrement
- The new blockIncrement.public int getUnitIncrement()
getUnitIncrement
in interface Adjustable
public int getBlockIncrement()
getBlockIncrement
in interface Adjustable
public int getValue()
getValue
in interface Adjustable
public void setValue(int value)
setValue
in interface Adjustable
value
- The new value of the scrollbar.public int getVisibleAmount()
getVisibleAmount
in interface Adjustable
public void setVisibleAmount(int extent)
setVisibleAmount
in interface Adjustable
extent
- The visible amount (AKA extent).public int getMinimum()
getMinimum
in interface Adjustable
public void setMinimum(int minimum)
setMinimum
in interface Adjustable
minimum
- The minimum value of the scrollbar.public int getMaximum()
getMaximum
in interface Adjustable
public void setMaximum(int maximum)
setMaximum
in interface Adjustable
maximum
- The maximum value of the scrollbar.public boolean getValueIsAdjusting()
public void setValueIsAdjusting(boolean b)
b
- The new isAdjusting value.public void setValues(int newValue, int newExtent, int newMin, int newMax)
newValue
- The new value.newExtent
- The new extent.newMin
- The new minimum.newMax
- The new maximum.public void addAdjustmentListener(AdjustmentListener listener)
addAdjustmentListener
in interface Adjustable
listener
- The listener to add.AdjustmentEvent
public void removeAdjustmentListener(AdjustmentListener listener)
removeAdjustmentListener
in interface Adjustable
listener
- The listener to remove.AdjustmentEvent
public AdjustmentListener[] getAdjustmentListeners()
protected void fireAdjustmentValueChanged(int id, int type, int value)
id
- The ID of the adjustment event.type
- The Type of change.value
- The new value for the property that was changed..public Dimension getMinimumSize()
getMinimumSize
in class JComponent
Component.setMinimumSize(java.awt.Dimension)
,
Component.getMinimumSize()
,
Component.isMinimumSizeSet()
,
ComponentUI.getMinimumSize(JComponent)
public Dimension getMaximumSize()
getMaximumSize
in class JComponent
Component.setMaximumSize(java.awt.Dimension)
,
Component.getMaximumSize()
,
Component.isMaximumSizeSet()
,
ComponentUI.getMaximumSize(JComponent)
public void setEnabled(boolean x)
setEnabled
in class JComponent
x
- Whether the scrollbar is enabled.Component.isEnabled()
,
Component.isLightweight()
protected String paramString()
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.
paramString
in class JComponent
JScrollBar
.public AccessibleContext getAccessibleContext()
JScrollBar
component.
getAccessibleContext
in interface Accessible
getAccessibleContext
in class JComponent
JScrollBar.AccessibleJScrollBar
).
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |