|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Container | +--javax.swing.JComponent | +--javax.swing.JPanel | +--com.ibm.spinner.SpinnerGUI | +--com.ibm.spinner.Spinner | +--com.ibm.spinner.NumericSpinner
A spinner which scrolls through a list of integers with bounded range. The current selected value is displayed in a textfield. The user can also enters an integer value as the current value.
Inner classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Fields inherited from class com.ibm.spinner.SpinnerGUI |
SPIN_HORIZONTAL,
SPIN_VERTICAL |
Fields inherited from class javax.swing.JComponent |
TOOL_TIP_TEXT_KEY,
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 |
Constructor Summary | |
NumericSpinner()
Creates a NumericSpinner using a bounded range model with a minimum as 0, maximum as 100, increment as 1 and current value as 0. |
|
NumericSpinner(int increment)
Creates a NumericSpinner using a bounded range model with a minimum as 0, maximum as 100 and current value as 0. |
|
NumericSpinner(int min,
int max)
Creates a NumericSpinner using a bounded range model with specified minimum and maximum value. |
|
NumericSpinner(int value,
int min,
int max,
int increment)
Creates a NumericSpinner using a bounded range model with specified values. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent event)
|
void |
focusLost(java.awt.event.FocusEvent e)
Invoked when a component loses the keyboard focus |
java.lang.String |
getAboutThisBean()
Returns a special formatted string intended for use by the editor of this property. |
java.awt.Color |
getBackground()
Gets the background color |
java.awt.Font |
getFont()
Returns the font |
java.awt.Color |
getForeground()
Returns the textfield foreground color |
int |
getIncrement()
Returns the increment value of NumericSpinner. |
int |
getMaximum()
Returns the maximum value of NumericSpinner. |
int |
getMinimum()
Returns the minimum value of NumericSpinner. |
javax.swing.BoundedRangeModel |
getModel()
Returns the data model currently used by the NumericSpinner. |
int |
getValue()
Returns the current value of NumericSpinner. |
void |
initMaximum(int maximum)
Sets the maximum value of NumericSpinner. |
void |
initMinimum(int minimum)
Sets the maximum value of NumericSpinner. |
boolean |
isEditable()
Indicates whether or not this text component is editable. |
boolean |
isEnabled()
Determines whether this component is enabled. |
boolean |
isSpinnable()
Indicates whether or not this text component is spinnable. |
void |
keyPressed(java.awt.event.KeyEvent e)
Event method of KeyListener. |
void |
keyTyped(java.awt.event.KeyEvent e)
Event method of KeyListener. |
void |
scrollDown()
Decrements the spinner's value by the increment. |
void |
scrollUp()
Increments the spinner's value by the increment. |
void |
setAboutThisBean(java.lang.String aboutThisBean)
Setter method for the aboutThisBean property to be available in the properties list. |
void |
setBackground(java.awt.Color c)
Sets the background color of this component. |
void |
setEditable(boolean aBoolean)
Sets whether text editing is enabled. |
void |
setEnabled(boolean b)
Enables or disables this component, depending on the value of the parameter b . |
void |
setFont(java.awt.Font f)
Sets the font of this component. |
void |
setForeground(java.awt.Color c)
Sets the foreground color of this component. |
void |
setIncrement(int increment)
Sets the increment value of NumericSpinner. |
void |
setMaximum(int maximum)
Sets the maximum value of NumericSpinner. |
void |
setMinimum(int minimum)
Sets the minimum value of NumericSpinner. |
void |
setModel(javax.swing.BoundedRangeModel newModel)
Sets the data model that the NumericSpinner uses to spin through. |
void |
setSpinnable(boolean aBoolean)
Sets whether text spinning is enabled. |
void |
setValue(int value)
Sets the current value of NumericSpinner. |
Methods inherited from class com.ibm.spinner.Spinner |
addChangeListener,
addSpinnerErrorEventListener,
isWrap,
removeChangeListener,
removeSpinnerErrorEventListener,
setWrap |
Methods inherited from class com.ibm.spinner.SpinnerGUI |
focusGained,
getColumns,
getDecrButtonArrowColor,
getEditable,
getIncrButtonArrowColor,
getMaximumSize,
getMinimumSize,
getOrientation,
getPreferredSize,
keyReleased,
mouseClicked,
mouseEntered,
mouseExited,
mousePressed,
mouseReleased,
setColumns,
setDecrButtonArrowColor,
setIncrButtonArrowColor,
setOpaque,
setOrientation,
setToolTipText,
stateChanged |
Methods inherited from class javax.swing.JPanel |
getAccessibleContext,
getUIClassID,
updateUI |
Methods inherited from class javax.swing.JComponent |
addAncestorListener,
addNotify,
addPropertyChangeListener,
addVetoableChangeListener,
computeVisibleRect,
contains,
createToolTip,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
firePropertyChange,
getActionForKeyStroke,
getAlignmentX,
getAlignmentY,
getAutoscrolls,
getBorder,
getBounds,
getClientProperty,
getConditionForKeyStroke,
getDebugGraphicsOptions,
getGraphics,
getHeight,
getInsets,
getInsets,
getLocation,
getNextFocusableComponent,
getRegisteredKeyStrokes,
getRootPane,
getSize,
getToolTipLocation,
getToolTipText,
getToolTipText,
getTopLevelAncestor,
getVisibleRect,
getWidth,
getX,
getY,
grabFocus,
hasFocus,
isDoubleBuffered,
isFocusCycleRoot,
isFocusTraversable,
isLightweightComponent,
isManagingFocus,
isOpaque,
isOptimizedDrawingEnabled,
isPaintingTile,
isRequestFocusEnabled,
isValidateRoot,
paint,
paintImmediately,
paintImmediately,
putClientProperty,
registerKeyboardAction,
registerKeyboardAction,
removeAncestorListener,
removeNotify,
removePropertyChangeListener,
removeVetoableChangeListener,
repaint,
repaint,
requestDefaultFocus,
requestFocus,
resetKeyboardActions,
reshape,
revalidate,
scrollRectToVisible,
setAlignmentX,
setAlignmentY,
setAutoscrolls,
setBorder,
setDebugGraphicsOptions,
setDoubleBuffered,
setMaximumSize,
setMinimumSize,
setNextFocusableComponent,
setPreferredSize,
setRequestFocusEnabled,
setVisible,
unregisterKeyboardAction,
update |
Methods inherited from class java.awt.Container |
add,
add,
add,
add,
add,
addContainerListener,
countComponents,
deliverEvent,
doLayout,
findComponentAt,
findComponentAt,
getComponent,
getComponentAt,
getComponentAt,
getComponentCount,
getComponents,
getLayout,
insets,
invalidate,
isAncestorOf,
layout,
list,
list,
locate,
minimumSize,
paintComponents,
preferredSize,
print,
printComponents,
remove,
remove,
removeAll,
removeContainerListener,
setLayout,
validate |
Methods inherited from class java.awt.Component |
action,
add,
addComponentListener,
addFocusListener,
addInputMethodListener,
addKeyListener,
addMouseListener,
addMouseMotionListener,
addPropertyChangeListener,
bounds,
checkImage,
checkImage,
contains,
createImage,
createImage,
disable,
dispatchEvent,
enable,
enable,
enableInputMethods,
getBounds,
getColorModel,
getComponentOrientation,
getCursor,
getDropTarget,
getFontMetrics,
getInputContext,
getInputMethodRequests,
getLocale,
getLocation,
getLocationOnScreen,
getName,
getParent,
getPeer,
getSize,
getToolkit,
getTreeLock,
gotFocus,
handleEvent,
hide,
imageUpdate,
inside,
isDisplayable,
isLightweight,
isShowing,
isValid,
isVisible,
keyDown,
keyUp,
list,
list,
list,
location,
lostFocus,
mouseDown,
mouseDrag,
mouseEnter,
mouseExit,
mouseMove,
mouseUp,
move,
nextFocus,
paintAll,
postEvent,
prepareImage,
prepareImage,
printAll,
remove,
removeComponentListener,
removeFocusListener,
removeInputMethodListener,
removeKeyListener,
removeMouseListener,
removeMouseMotionListener,
removePropertyChangeListener,
repaint,
repaint,
repaint,
resize,
resize,
setBounds,
setBounds,
setComponentOrientation,
setCursor,
setDropTarget,
setLocale,
setLocation,
setLocation,
setName,
setSize,
setSize,
show,
show,
size,
toString,
transferFocus |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
wait,
wait,
wait |
Constructor Detail |
public NumericSpinner()
public NumericSpinner(int increment)
increment
- the amount of the current value changes when
scrolling up or down.public NumericSpinner(int min, int max)
min
- the minimum value of the bounded range model.max
- the maximum value of the bounded range model.public NumericSpinner(int value, int min, int max, int increment)
value
- the current value being displayed.min
- the minimum value of the bounded range model.max
- the maximum value of the bounded range model.increment
- the amount of the current value changes when
scrolling up or down.Method Detail |
public void actionPerformed(java.awt.event.ActionEvent event)
public void focusLost(java.awt.event.FocusEvent e)
e
- FocusEventpublic java.lang.String getAboutThisBean()
public java.awt.Color getBackground()
public java.awt.Font getFont()
public java.awt.Color getForeground()
public int getIncrement()
public int getMaximum()
public int getMinimum()
public javax.swing.BoundedRangeModel getModel()
public int getValue()
public void initMaximum(int maximum)
the
- maximum value to set.public void initMinimum(int minimum)
the
- maximum value to set.public boolean isEditable()
true
if this text component is
editable; false
otherwise.setEditable(boolean)
public boolean isEnabled()
setEnabled
method.true
if the component is enabled;
false
otherwise.setEnabled(boolean)
public boolean isSpinnable()
true
if this text component is
spinnable; false
otherwise.setSpinnable(boolean)
public void keyPressed(java.awt.event.KeyEvent e)
e
- KeyEventpublic void keyTyped(java.awt.event.KeyEvent e)
e
- KeyEventpublic void scrollDown()
public void scrollUp()
public void setAboutThisBean(java.lang.String aboutThisBean)
newValue
- the special formatted stringpublic void setBackground(java.awt.Color c)
c
- The color to become this component's
background color.getBackground()
public void setEditable(boolean aBoolean)
aBoolean
- booleanpublic void setEnabled(boolean b)
b
. An enabled component can respond to user
input and generate events. Components are enabled initially by default.b
- If true
, this component is
enabled; otherwise this component is disabled.isEnabled()
public void setFont(java.awt.Font f)
f
- The font to become this component's font.getFont()
public void setForeground(java.awt.Color c)
c
- The color to become this component's
foreground color.getForeground()
public void setIncrement(int increment)
increment
- the increment value to set.public void setMaximum(int maximum)
the
- maximum value to set.public void setMinimum(int minimum)
minimum
- the minimum value to set.public void setModel(javax.swing.BoundedRangeModel newModel)
newModel
- the BoundedRangeModel that provides numeric values
to spin through.public void setSpinnable(boolean aBoolean)
aBoolean
- booleanpublic void setValue(int value)
the
- value to be set.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |