SpinnerListModel (Java Platform SE 8 ) (original) (raw)


public class SpinnerListModel
extends AbstractSpinnerModel
implements Serializable
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 callingfireStateChanged.
This model inherits a ChangeListener. The ChangeListeners are notified whenever the model's value or list properties changes.
Since:
1.4
See Also:
JSpinner, SpinnerModel, AbstractSpinnerModel, SpinnerNumberModel, SpinnerDateModel

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.