Methods Summary |
---|
public void | addChangeListener(javax.swing.event.ChangeListener l)Adds a ChangeListener to the model's listener list. The
ChangeListeners must be notified when the models value changes.
listenerList.add(ChangeListener.class, l);
|
protected void | fireStateChanged()Run each ChangeListeners stateChanged() method.
Object[] listeners = listenerList.getListenerList();
for (int i = listeners.length - 2; i >= 0; i -=2 ) {
if (listeners[i] == ChangeListener.class) {
if (changeEvent == null) {
changeEvent = new ChangeEvent(this);
}
((ChangeListener)listeners[i+1]).stateChanged(changeEvent);
}
}
|
public javax.swing.event.ChangeListener[] | getChangeListeners()Returns an array of all the ChangeListener s added
to this AbstractSpinnerModel with addChangeListener().
return (ChangeListener[])listenerList.getListeners(
ChangeListener.class);
|
public T[] | getListeners(java.lang.Class listenerType)Return an array of all the listeners of the given type that
were added to this model. For example to find all of the
ChangeListeners added to this model:
myAbstractSpinnerModel.getListeners(ChangeListener.class);
return listenerList.getListeners(listenerType);
|
public void | removeChangeListener(javax.swing.event.ChangeListener l)Removes a ChangeListener from the model's listener list.
listenerList.remove(ChangeListener.class, l);
|