Warning
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version of Swing. As of 1.4, support for long term storage
of all JavaBeans
has been added to the java.beans package.
Please see java..
| Modifier and Type | Field and Description |
|---|---|
| protected transient ChangeEvent | changeEvent
Only one ModelChangeEvent is needed per model instance since the event's only (read-only) state is the source property. |
| private int | |
| protected EventListenerList | listenerList
The collection of registered listeners |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addChangeListener(ChangeListener l)
Implements javax. Adds a |
| public void | clearSelection()
Implements javax. Clears the selection (to -1). |
| protected void | fireStateChanged()
Notifies all listeners that have registered interest for notification on this event type. |
| public ChangeListener[] | Returns: all of this model'sChangeListeners
or an empty
array if no change listeners are currently registeredReturns an array of all the change listeners
registered on this |
| public < the type of T extends EventListener> T[]EventListener class being requested | Returns: an array of all objects registered asFooListeners
on this model,
or an empty array if no such
listeners have been addedthe type of listeners requested;
this parameter should specify an interface
that descends from listenerType)java.util.EventListenerReturns an array of all the objects currently registered as
|
| public int | getSelectedIndex()
Implements javax. Returns the model's selection. |
| public boolean | isSelected()
Implements javax. Returns true if the selection model currently has a selected value. |
| public void | removeChangeListener(ChangeListener l)
Implements javax. Removes a |
| public void | setSelectedIndex(int index)
Implements javax. Sets the model's selected index to index. |
| changeEvent | back to summary |
|---|---|
| protected transient ChangeEvent changeEvent Only one ModelChangeEvent is needed per model instance since the event's only (read-only) state is the source property. The source of events generated here is always "this". | |
| index | back to summary |
|---|---|
| private int index | |
| listenerList | back to summary |
|---|---|
| protected EventListenerList listenerList The collection of registered listeners | |
| DefaultSingleSelectionModel | back to summary |
|---|---|
| public DefaultSingleSelectionModel() Constructs a | |
| addChangeListener | back to summary |
|---|---|
| public void addChangeListener(ChangeListener l) Implements javax. Adds a | |
| clearSelection | back to summary |
|---|---|
| public void clearSelection() Implements javax. Doc from javax. Clears the selection (to -1). | |
| fireStateChanged | back to summary |
|---|---|
| protected void fireStateChanged() Notifies all listeners that have registered interest for notification on this event type. The event instance is created lazily.
| |
| getChangeListeners | back to summary |
|---|---|
| public ChangeListener[] getChangeListeners() Returns an array of all the change listeners
registered on this
| |
| getListeners | back to summary |
|---|---|
| public <T extends EventListener> T[] getListeners(Class<T> listenerType) Returns an array of all the objects currently registered as
You can specify the ChangeListener[] cls = (ChangeListener[])(m.getListeners(ChangeListener.class));If no such listeners exist, this method returns an empty array.
| |
| getSelectedIndex | back to summary |
|---|---|
| public int getSelectedIndex() Implements javax. Doc from javax. Returns the model's selection. | |
| isSelected | back to summary |
|---|---|
| public boolean isSelected() Implements javax. Doc from javax. Returns true if the selection model currently has a selected value. | |
| removeChangeListener | back to summary |
|---|---|
| public void removeChangeListener(ChangeListener l) Implements javax. Removes a | |
| setSelectedIndex | back to summary |
|---|---|
| public void setSelectedIndex(int index) Implements javax. Doc from javax. Sets the model's selected index to index. Notifies any listeners if the model changes | |