| 
 | JavaTM 2 Platform Standard Ed. 5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface SpinnerModel
A model for a potentially unbounded sequence of object values.  This model
 is similar to 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.
JSpinner, 
AbstractSpinnerModel, 
SpinnerListModel, 
SpinnerNumberModel, 
SpinnerDateModel| Method Summary | |
|---|---|
|  void | addChangeListener(ChangeListener l)Adds a ChangeListenerto the model's listener list. | 
|  Object | getNextValue()Return the object in the sequence that comes after the object returned by getValue(). | 
|  Object | getPreviousValue()Return the object in the sequence that comes before the object returned by getValue(). | 
|  Object | getValue()The current element of the sequence. | 
|  void | removeChangeListener(ChangeListener l)Removes a ChangeListenerfrom the model's listener list. | 
|  void | setValue(Object value)Changes current value of the model, typically this value is displayed by the editorpart of aJSpinner. | 
| Method Detail | 
|---|
Object getValue()
editor part of a JSpinner.
setValue(java.lang.Object)void setValue(Object value)
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.
IllegalArgumentException - if value isn't allowedgetValue()Object getNextValue()
getValue(). If the end of the sequence has been reached 
 then return null.  Calling this method does not effect value.
getValue(), 
getPreviousValue()Object getPreviousValue()
getValue().  If the end of the sequence has been reached then 
 return null. Calling this method does not effect value.
getValue(), 
getNextValue()void addChangeListener(ChangeListener l)
ChangeListener to the model's listener list.  The 
 ChangeListeners must be notified when models value 
 changes.
l - the ChangeListener to addremoveChangeListener(javax.swing.event.ChangeListener)void removeChangeListener(ChangeListener l)
ChangeListener from the model's listener list.
l - the ChangeListener to removeaddChangeListener(javax.swing.event.ChangeListener)| 
 | JavaTM 2 Platform Standard Ed. 5.0 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Copyright 2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.