gui.date
Class CyclingSpinnerListModel
java.lang.Object
javax.swing.AbstractSpinnerModel
javax.swing.SpinnerListModel
gui.date.CyclingSpinnerListModel
- All Implemented Interfaces:
- java.io.Serializable, javax.swing.SpinnerModel
public class CyclingSpinnerListModel
- extends javax.swing.SpinnerListModel
This example implements a SpinnerListModel that works only with
an Object array and that implements cycling (the next
value and previous value are never null). It also
lets you optionally associate a spinner model that's
linked to this one, so that when a cycle occurs the
linked spinner model is updated.
The SpinnerDemos use the CyclingSpinnerListModel for
a month spinner that (in RunDatePanel) is tied to the
year spinner, so that -- for example -- when the month
changes from December to January, the year increases.
- See Also:
- Serialized Form
Methods inherited from class javax.swing.SpinnerListModel |
getList, getValue, setList, setValue |
Methods inherited from class javax.swing.AbstractSpinnerModel |
addChangeListener, getChangeListeners, getListeners, removeChangeListener |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
CyclingSpinnerListModel
public CyclingSpinnerListModel(java.lang.Object[] values)
setLinkedModel
public void setLinkedModel(javax.swing.SpinnerModel linkedModel)
getNextValue
public java.lang.Object getNextValue()
- Specified by:
getNextValue
in interface javax.swing.SpinnerModel
- Overrides:
getNextValue
in class javax.swing.SpinnerListModel
getPreviousValue
public java.lang.Object getPreviousValue()
- Specified by:
getPreviousValue
in interface javax.swing.SpinnerModel
- Overrides:
getPreviousValue
in class javax.swing.SpinnerListModel