Package docking.widgets.spinner
Class IntegerSpinner
java.lang.Object
docking.widgets.spinner.IntegerSpinner
Creates a component for editing Integer values using an
IntegerTextField
and a JSpinner
.-
Constructor Summary
ConstructorDescriptionIntegerSpinner
(SpinnerNumberModel spinnerModel) Creates a new IntegerSpinner using the given spinner model.IntegerSpinner
(SpinnerNumberModel spinnerModel, int columns) Creates a new IntegerSpinner using the given spinner model. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addChangeListener
(ChangeListener listener) Adds a ChangeListener to the model's listener list.protected void
Run each ChangeListeners stateChanged() method.Returns the JSpinner that has been attached to the text field.Returns the IntegerTextField that has been attached to the spinner.void
removeChangeListener
(ChangeListener listener) Removes a ChangeListener from the model's listener list.void
Sets the given value to both the spinner and the text field.
-
Constructor Details
-
IntegerSpinner
Creates a new IntegerSpinner using the given spinner model.- Parameters:
spinnerModel
- the spinner model to use in the JSpinner.
-
IntegerSpinner
Creates a new IntegerSpinner using the given spinner model.- Parameters:
spinnerModel
- the spinner model to use in the JSpinner.
-
-
Method Details
-
getSpinner
Returns the JSpinner that has been attached to the text field.- Returns:
- the JSpinner that has been attached to the text field
-
getTextField
Returns the IntegerTextField that has been attached to the spinner.- Returns:
- the IntegerTextField that has been attached to the spinner.
-
setValue
Sets the given value to both the spinner and the text field.- Parameters:
value
- the value to set.
-
addChangeListener
Adds a ChangeListener to the model's listener list. The ChangeListeners must be notified when the models value changes.- Parameters:
listener
- the ChangeListener to add
-
removeChangeListener
Removes a ChangeListener from the model's listener list.- Parameters:
listener
- the ChangeListener to remove
-
fireStateChanged
protected void fireStateChanged()Run each ChangeListeners stateChanged() method.- See Also:
-