Serializable
, SpinnerModel
SpinnerDateModel
, SpinnerListModel
, SpinnerNumberModel
public abstract class AbstractSpinnerModel extends Object implements SpinnerModel, Serializable
setValue
, getValue
, getNextValue
and getPreviousValue
methods.Modifier and Type | Field | Description |
---|---|---|
protected EventListenerList |
listenerList |
The list of ChangeListeners for this model. |
Modifier | Constructor | Description |
---|---|---|
protected |
Constructor for subclasses to call. |
Modifier and Type | Method | Description |
---|---|---|
void |
addChangeListener |
Adds a ChangeListener to the model's listener list. |
protected void |
fireStateChanged() |
Run each ChangeListeners stateChanged() method. |
ChangeListener[] |
getChangeListeners() |
Returns an array of all the ChangeListener s added to this AbstractSpinnerModel with addChangeListener(). |
<T extends EventListener> |
getListeners |
Return an array of all the listeners of the given type that were added to this model. |
void |
removeChangeListener |
Removes a ChangeListener from the model's listener list. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getNextValue, getPreviousValue, getValue, setValue
protected EventListenerList listenerList
protected AbstractSpinnerModel()
public void addChangeListener(ChangeListener l)
addChangeListener
in interface SpinnerModel
l
- the ChangeListener to addpublic void removeChangeListener(ChangeListener l)
removeChangeListener
in interface SpinnerModel
l
- the ChangeListener to removepublic ChangeListener[] getChangeListeners()
ChangeListener
s added to this AbstractSpinnerModel with addChangeListener().ChangeListener
s added or an empty array if no listeners have been addedprotected void fireStateChanged()
public <T extends EventListener> T[] getListeners(Class<T> listenerType)
myAbstractSpinnerModel.getListeners(ChangeListener.class);
T
- the type of requested listenerslistenerType
- the type of listeners to return, e.g. ChangeListener.class
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/AbstractSpinnerModel.html