java.lang.Object
javax.swing.DefaultSingleSelectionModel
- All Implemented Interfaces:
Serializable
,SingleSelectionModel
public class DefaultSingleSelectionModel
extends Object
implements SingleSelectionModel, Serializable
A generic implementation of SingleSelectionModel.
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 XMLEncoder
.
- Since:
- 1.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ChangeEvent
Only one ModelChangeEvent is needed per model instance since the event's only (read-only) state is the source property.protected EventListenerList
The collection of registered listeners -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds aChangeListener
to the button.void
Clears the selection (to -1).protected void
Notifies all listeners that have registered interest for notification on this event type.Returns an array of all the change listeners registered on thisDefaultSingleSelectionModel
.<T extends EventListener>
T[]getListeners
(Class<T> listenerType) Returns an array of all the objects currently registered asFooListener
s upon this model.int
Returns the model's selection.boolean
Returns true if the selection model currently has a selected value.void
Removes aChangeListener
from the button.void
setSelectedIndex
(int index) Sets the model's selected index to index.