AS/400 Toolbox for Java \ Graphical Toolbox \ Spinner

Spinner

Start changeThe spinner class is a component of the Graphical Toolbox. It has two small direction buttons that let the user scroll a list of predetermined values and select one. In some instances, the user may enter a new legal value.

There are several specific spinner classes that you can use:

Properties

Property Description Data Type Flags* Default Value Valid Value
background The background color of this component. Note: This property does not apply to ObjectListSpinner unless it is in edit mode. java.awt.Color R, W, B java.awt.Color.white any instance of Color
foreground The foreground color of this component. Note:This property does not apply to ObjectListSpinner unless it is in edit mode. java.awt.Color R, W, B java.awt.Color.black any instance of Color
font The font of this component. Note:This property does not apply to ObjectListSpinner unless it is in edit mode. java.awt.Font R, W, B new java.awt.Font("dialog", java.awt.Font.PLAIN, 12) any instance of Font
opaque Marks whether this component is opaque. Note:This property does not apply to ObjectListSpinner unless it is in edit mode. boolean R, W, B True True - opaque
False - not opaque
columns The columns of the input field, which is used to validate the layout. Note: columns is a property derived from Swing JTextField. The function of columns in Spinner is similar to its function in Swing JTextField. This property does not apply to ObjectListSpinner. int R, W, B 20 columns>0
enabled Marks whether this component is enabled. boolean R, W, B True True - enabled False - disabled
editable Marks whether this component is editable. boolean R, W, B True True - editable False - not editable
incrButtonArrowColor The color of the increment arrow button. java.awt.Color R, W, B java.awt.Color.black Any instance of Color
decrButtonArrowColor The color of the decrement arrow button. java.awt.Color R, W, B java.awt.Color.black Any instance of Color
orientation The orientation of the arrow button. int R, W, B 0 0 - SPIN_VERTICAL
(display name: VERTICAL)

1 - SPIN_HORIZONTAL (display name: HORIZONTAL)

wrap Marks whether the wrap action is allowed. If wrap is true, the wrap action is allowed. In this case, assume Spinner's value is set to the maximum. If Spinner is scrolled up, the value will change to its minimum. Assuming Spinner's value is set to the minimum, if Spinner is scrolled down, the value will change to its maximum.

If wrap is false, the wrap action is forbidden. If Spinner's value is set to the maximum, it cannot be scrolled up. If Spinner's Value is set to the minimum, it cannot be scrolled down.

boolean R, W, B True True - the wrap action is allowed
False - the wrap action is forbidden
* R = read, W = write, B = bound, E = expert

Events

The spinner bean suite fires the following events:

Methods

The spinner bean suite implements the following methods:

Vertical Button Screen
The vertical button orientation spinner bean is shown below at its default orientation.


Horizontal Button Screen
The vertical button orientation spinner bean shown below is an example of after you set the "orientation" property to "HORIZONTAL".

The value that is currently selected is displayed in an input field. You can set the current value either by clicking on the arrow buttons or by typing a string into the input field.End change


[ Information Center Home Page | Feedback ] [ Legal | AS/400 Glossary ]