public class JScrollBar extends JComponent implements Adjustable
| Modifier and Type | Field and Description |
|---|---|
protected java.util.Vector |
_adjustmentListeners
A list of AdjustmentListeners registered for this component.
|
_border_alignmentX, _alignmentY, _background, _cursesColor, _enabled, _focusListeners, _foreground, _keyListeners, _origin, _parent, _visible, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTHORIZONTAL, VERTICAL| Constructor and Description |
|---|
JScrollBar()
Creates a vertical scrollbar with default values.
|
JScrollBar(int orientation_)
Creates a scrollbar with the specified orientation
and with default values.
|
JScrollBar(int orientation_,
int value_,
int extent_,
int min_,
int max_)
Creates a scrollbar with the specified orientation, value,
extent, min and max.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAdjustmentListener(AdjustmentListener listener_)
Register an AdjustmentListener object for this component.
|
void |
debug(int level_) |
void |
draw()
Draws the border of the component (if there is one).
|
int |
getBlockIncrement()
Gets the block increment (the amount by which the value will
change when the arrow keys are pressed).
|
int |
getHeight() |
int |
getMaximum()
Gets the maximum value of the adjustable object.
|
int |
getMinimum()
Gets the minimum value of the adjustable object.
|
int |
getOrientation()
Gets the scrollbar's orientation (VERTICAL or HORIZONTAL)
|
Dimension |
getSize()
Get the screen size of the scrollbar.
|
int |
getValue()
Gets the value of the adjustable object.
|
int |
getVisibleAmount()
Gets the length of the proportional indicator.
|
int |
getWidth() |
Dimension |
minimumSize() |
void |
processAdjustmentEvent(AdjustmentEvent evt_) |
void |
processKeyEvent(KeyEvent ke_)
Invoke all the KeyListener callbacks that may have been registered
for this component.
|
void |
removeAdjustmentListener(AdjustmentListener listener_) |
void |
requestFocus()
This method should be invoked by all subclasses of Component
which override this method; because this method generates the
FOCUS_GAINED event when the component gains the keyboard focus.
|
void |
setBlockIncrement(int val_)
Sets the block increment of the scrollbar.
|
void |
setMaximum(int max_)
Set the scrollbar's maximum value.
|
void |
setMinimum(int min_)
Set the scrollbar's minimum value.
|
void |
setSize(Dimension size_)
Set the size of the component on the screen.
|
void |
setValue(int value_)
Set the scrollbar's value.
|
void |
setVisibleAmount(int extent_)
Set the scrollbar's extent (a.k.a "visible amount").
|
getBorder, getInsets, setBorderaddFocusListener, addKeyListener, contains, contains, getAlignmentX, getAlignmentY, getAncestorWindow, getBackground, getBounds, getCursesColor, getForeground, getLocation, getLocationOnScreen, getName, getParent, hasFocus, hide, invalidate, isDisplayed, isEnabled, isFocusTraversable, isRecursivelyVisible, isTotallyObscured, isValid, isVisible, processEvent, processFocusEvent, processMouseEvent, repaint, requestSync, setBackground, setBounds, setBounds, setBounds, setEnabled, setForeground, setLocation, setLocation, setName, setParent, setVisible, show, validate, validateCursesColorprotected java.util.Vector _adjustmentListeners
public JScrollBar()
public JScrollBar(int orientation_)
public JScrollBar(int orientation_,
int value_,
int extent_,
int min_,
int max_)
public int getOrientation()
getOrientation in interface Adjustablepublic void setMinimum(int min_)
setMinimum in interface Adjustablepublic void setValue(int value_)
setValue in interface Adjustablepublic void setVisibleAmount(int extent_)
setVisibleAmount in interface Adjustablepublic void setMaximum(int max_)
setMaximum in interface Adjustablepublic void setBlockIncrement(int val_)
setBlockIncrement in interface Adjustablepublic void setSize(Dimension size_)
public Dimension getSize()
public void draw()
JComponentdraw in class JComponentpublic void processKeyEvent(KeyEvent ke_)
ComponentprocessKeyEvent in class Componentpublic void requestFocus()
ComponentrequestFocus in class Componentpublic void addAdjustmentListener(AdjustmentListener listener_)
addAdjustmentListener in interface Adjustablepublic void removeAdjustmentListener(AdjustmentListener listener_)
removeAdjustmentListener in interface Adjustablepublic void processAdjustmentEvent(AdjustmentEvent evt_)
processAdjustmentEvent in interface Adjustablepublic Dimension minimumSize()
minimumSize in class Componentpublic int getMinimum()
AdjustablegetMinimum in interface Adjustablepublic int getValue()
AdjustablegetValue in interface Adjustablepublic int getVisibleAmount()
AdjustablegetVisibleAmount in interface Adjustablepublic int getMaximum()
AdjustablegetMaximum in interface Adjustablepublic int getBlockIncrement()
AdjustablegetBlockIncrement in interface Adjustable