|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.DefaultSingleSelectionModel
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. A future release of Swing will provide support for long term persistence.
Field Summary | |
protected ChangeEvent |
changeEvent
|
protected EventListenerList |
listenerList
The collection of registered listeners |
Constructor Summary | |
DefaultSingleSelectionModel()
|
Method Summary | |
void |
addChangeListener(ChangeListener l)
Adds a ChangeListener to the button. |
void |
clearSelection()
Clears the selection (to -1). |
protected void |
fireStateChanged()
|
EventListener[] |
getListeners(Class listenerType)
Return an array of all the listeners of the given type that were added to this model. |
int |
getSelectedIndex()
Returns the model's selection. |
boolean |
isSelected()
Returns true if the selection model currently has a selected value. |
void |
removeChangeListener(ChangeListener l)
Removes a ChangeListener from the button. |
void |
setSelectedIndex(int index)
Sets the model's selected index to index. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected transient ChangeEvent changeEvent
protected EventListenerList listenerList
Constructor Detail |
public DefaultSingleSelectionModel()
Method Detail |
public int getSelectedIndex()
SingleSelectionModel
getSelectedIndex
in interface SingleSelectionModel
javax.swing.SingleSelectionModel
SingleSelectionModel.setSelectedIndex(int)
public void setSelectedIndex(int index)
SingleSelectionModel
setSelectedIndex
in interface SingleSelectionModel
javax.swing.SingleSelectionModel
an
- int specifying the model selectionSingleSelectionModel.getSelectedIndex()
,
SingleSelectionModel.addChangeListener(javax.swing.event.ChangeListener)
public void clearSelection()
SingleSelectionModel
clearSelection
in interface SingleSelectionModel
public boolean isSelected()
SingleSelectionModel
isSelected
in interface SingleSelectionModel
javax.swing.SingleSelectionModel
public void addChangeListener(ChangeListener l)
addChangeListener
in interface SingleSelectionModel
javax.swing.SingleSelectionModel
l
- the ChangeListener to addpublic void removeChangeListener(ChangeListener l)
removeChangeListener
in interface SingleSelectionModel
javax.swing.SingleSelectionModel
l
- the ChangeListener to removeprotected void fireStateChanged()
public EventListener[] getListeners(Class listenerType)
|
JavaTM 2 Platform Std. Ed. v1.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Java, Java 2D, and JDBC are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2001 Sun Microsystems, Inc. 901 San Antonio Road
Palo Alto, California, 94303, U.S.A. All Rights Reserved.