| public interface javax.swing SpinnerModel
|
Java SE 6 |
ListModel however there are some important differences:
A SpinnerModel has three properties, only the first is read/write.
value
nextValue
value is the
last element of the sequence.
previousValue
value is the
first element of the sequence.
value property changes,
ChangeListeners are notified. SpinnerModel may
choose to notify the ChangeListeners under other circumstances.
| version | 1.7 11/17/05 |
| since | 1.4 |
| See also | javax.swing.JSpinner, javax.swing.AbstractSpinnerModel, javax.swing.SpinnerListModel, javax.swing.SpinnerNumberModel, javax.swing.SpinnerDateModel |
| Methods | |||||
|---|---|---|---|---|---|
| public void | addChangeListener(ChangeListener l) Details
Adds a ChangeListener to the model's listener list. The
ChangeListeners must be notified when models value
changes.
| ||||
| public void | removeChangeListener(ChangeListener l) Details
Removes a ChangeListener from the model's listener list.
| ||||
| Properties | |||||
|---|---|---|---|---|---|
| public Object | getNextValue() Details
Return the object in the sequence that comes after the object returned
by getValue(). If the end of the sequence has been reached
then return null. Calling this method does not effect value.
| ||||
| public Object | getPreviousValue() Details
Return the object in the sequence that comes before the object returned
by getValue(). If the end of the sequence has been reached then
return null. Calling this method does not effect value.
| ||||
| public void | setValue(Object value) Details
Changes current value of the model, typically this value is displayed
by the editor part of a JSpinner.
If the SpinnerModel implementation doesn't support
the specified value then an IllegalArgumentException
is thrown. For example a SpinnerModel for numbers might
only support values that are integer multiples of ten. In
that case, model.setValue(new Number(11))
would throw an exception.
| ||||
| public Object | getValue() Details
The current element of the sequence. This element is usually
displayed by the editor part of a JSpinner.
| ||||
| About DocWeb · Bundles · Export · Export All | Top 10 · Statistics · Login |
| About Sun · Contact · Privacy · Terms of Use · Trademarks | Java SE 6 · Copyright © 1994-2009 Sun Microsystems, Inc.All rights reserved. Use is subject to license terms |
![]() |
![]() |
|