A simple implementation of
SpinnerModel
whose
values are defined by an array or a
List
.
For example to create a model defined by
an array of the names of the days of the week:
String[] days = new DateFormatSymbols().getWeekdays();
SpinnerModel model = new SpinnerListModel(Arrays.asList(days).subList(1, 8));
This class only stores a reference to the array or
List
so if an element of the underlying sequence changes, it's up
to the application to notify the
ChangeListeners
by calling
fireStateChanged
.
This model inherits a ChangeListener
.
The ChangeListener
s are notified whenever the
model's value
or list
properties changes.