All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.java.swing.Spinner
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----com.sun.java.swing.JComponent
|
+----com.sun.java.swing.Spinner
- public class Spinner
- extends JComponent
- implements Adjustable, AdjustmentListener
A typein field for an integer.
-
ascent
-
-
d
-
-
digitsTyped
-
-
fm
-
-
haveFocus
-
-
maxValue
-
-
minValue
-
-
nDigits
-
-
target
-
-
txt
-
-
value
-
-
wrapped
-
-
wraps
-
-
Spinner(int)
-
-
Spinner(int, String)
-
-
addAdjustmentListener(AdjustmentListener)
- Add a listener to recieve adjustment events when the value of
the Spinner changes.
-
adjustmentValueChanged(AdjustmentEvent)
- Spinners can both send and recieve AdjustmentEvents -- they
can be cascaded together for situations where there are multiple
ways to enter the same value (popup menu or typin number)
-
getBlockIncrement()
- Does nothing -- part of the Adjustable interface.
-
getDigits()
-
-
getMaximum()
- Gets the maximum value of the Spinner.
-
getMinimum()
- Gets the minimum value of the Spinner.
-
getMinimumSize()
-
-
getOrientation()
- Does nothing -- part of the Adjustable interface.
-
getPreferredSize()
-
-
getText()
-
-
getUnitIncrement()
- Does nothing -- part of the Adjustable interface.
-
getValue()
- Gets the current value of the Spinner object.
-
getVisibleAmount()
- Does nothing -- part of the Adjustable interface.
-
getWrap()
-
-
hasFocus()
- Returns true if this Container has the keyboard focus.
-
isFocusTraversable()
-
-
paint(Graphics)
-
-
processFocusEvent(FocusEvent)
-
-
processKeyEvent(KeyEvent)
- Override processKeyEvent to process events
-
processMouseEvent(MouseEvent)
-
-
removeAdjustmentListener(AdjustmentListener)
- Removes an adjustment listener.
-
setBlockIncrement(int)
- Does nothing -- part of the Adjustable interface.
-
setDigits(int)
-
-
setFont(Font)
-
-
setMaximum(int)
- Sets the maximum value of the Spinner.
-
setMinimum(int)
- Sets the minimum value of the Spinner.
-
setText(String)
- A Spinner can have a string associated with it, which is placed
at the right of the number
-
setUnitIncrement(int)
- Does nothing -- part of the Adjustable interface.
-
setValue(int)
- Sets the current value of the Spinner.
-
setVisibleAmount(int)
- Does nothing -- part of the Adjustable interface.
-
setWrap(boolean)
- A Spinner for which wrapping is true wraps around to the minimum
value when the maximum value is exceeded, and vice versa.
-
update(Graphics)
-
txt
protected String txt
d
protected Dimension d
ascent
protected int ascent
value
protected int value
haveFocus
protected boolean haveFocus
minValue
protected int minValue
maxValue
protected int maxValue
target
protected AdjustmentListener target
fm
protected FontMetrics fm
nDigits
protected int nDigits
digitsTyped
protected int digitsTyped
wraps
protected boolean wraps
wrapped
public boolean wrapped
Spinner
public Spinner(int init,
String t)
Spinner
public Spinner(int init)
getValue
public int getValue()
- Gets the current value of the Spinner object.
setValue
public void setValue(int v)
- Sets the current value of the Spinner. This
value must be within the range defined by the minimum and
maximum values for this object.
- Parameters:
- v - the current value
setWrap
public void setWrap(boolean w)
- A Spinner for which wrapping is true wraps around to the minimum
value when the maximum value is exceeded, and vice versa.
- Parameters:
- w - true if wrapping is to be enabled, false if the
value is to be clamped.
getWrap
public boolean getWrap()
setText
public void setText(String s)
- A Spinner can have a string associated with it, which is placed
at the right of the number
- Parameters:
- s - the new text value
getText
public String getText()
setFont
public void setFont(Font f)
- Overrides:
- setFont in class Component
setDigits
public void setDigits(int n)
getDigits
public int getDigits()
processFocusEvent
protected void processFocusEvent(FocusEvent e)
- Overrides:
- processFocusEvent in class Component
processKeyEvent
protected void processKeyEvent(KeyEvent e)
- Override processKeyEvent to process events
- Overrides:
- processKeyEvent in class JComponent
processMouseEvent
protected void processMouseEvent(MouseEvent e)
- Overrides:
- processMouseEvent in class Component
getPreferredSize
public Dimension getPreferredSize()
- Overrides:
- getPreferredSize in class JComponent
getMinimumSize
public Dimension getMinimumSize()
- Overrides:
- getMinimumSize in class JComponent
isFocusTraversable
public boolean isFocusTraversable()
- Overrides:
- isFocusTraversable in class JComponent
hasFocus
public boolean hasFocus()
- Returns true if this Container has the keyboard focus.
- Overrides:
- hasFocus in class JComponent
paint
public void paint(Graphics g)
- Overrides:
- paint in class JComponent
update
public void update(Graphics g)
- Overrides:
- update in class Container
adjustmentValueChanged
public void adjustmentValueChanged(AdjustmentEvent e)
- Spinners can both send and recieve AdjustmentEvents -- they
can be cascaded together for situations where there are multiple
ways to enter the same value (popup menu or typin number)
setMinimum
public void setMinimum(int min)
- Sets the minimum value of the Spinner.
- Parameters:
- min - the minimum value
getMinimum
public int getMinimum()
- Gets the minimum value of the Spinner.
setMaximum
public void setMaximum(int max)
- Sets the maximum value of the Spinner.
- Parameters:
- max - the maximum value
getMaximum
public int getMaximum()
- Gets the maximum value of the Spinner.
addAdjustmentListener
public void addAdjustmentListener(AdjustmentListener l)
- Add a listener to recieve adjustment events when the value of
the Spinner changes.
- Parameters:
- l - the listener to recieve events
- See Also:
- AdjustmentEvent
removeAdjustmentListener
public void removeAdjustmentListener(AdjustmentListener l)
- Removes an adjustment listener.
- Parameters:
- l - the listener being removed
- See Also:
- AdjustmentEvent
setUnitIncrement
public void setUnitIncrement(int u)
- Does nothing -- part of the Adjustable interface.
- Parameters:
- u - the unit increment
getUnitIncrement
public int getUnitIncrement()
- Does nothing -- part of the Adjustable interface.
setBlockIncrement
public void setBlockIncrement(int b)
- Does nothing -- part of the Adjustable interface.
- Parameters:
- b - the block increment
getBlockIncrement
public int getBlockIncrement()
- Does nothing -- part of the Adjustable interface.
setVisibleAmount
public void setVisibleAmount(int v)
- Does nothing -- part of the Adjustable interface.
- Parameters:
- v - the length of the indicator
getVisibleAmount
public int getVisibleAmount()
- Does nothing -- part of the Adjustable interface.
getOrientation
public int getOrientation()
- Does nothing -- part of the Adjustable interface.
All Packages Class Hierarchy This Package Previous Next Index