FileDocCategorySizeDatePackage
SingleSelectionModel.javaAPI DocJava SE 5 API1547Fri Aug 26 14:57:58 BST 2005javax.swing

SingleSelectionModel

public interface SingleSelectionModel
A model that supports at most one indexed selection.
version
1.19 12/19/03
author
Dave Moore

Fields Summary
Constructors Summary
Methods Summary
public voidaddChangeListener(javax.swing.event.ChangeListener listener)
Adds listener as a listener to changes in the model.

param
listener the ChangeListener to add

public voidclearSelection()
Clears the selection (to -1).

public intgetSelectedIndex()
Returns the model's selection.

return
the model's selection, or -1 if there is no selection
see
#setSelectedIndex

public booleanisSelected()
Returns true if the selection model currently has a selected value.

return
true if a value is currently selected

public voidremoveChangeListener(javax.swing.event.ChangeListener listener)
Removes listener as a listener to changes in the model.

param
listener the ChangeListener to remove

public voidsetSelectedIndex(int index)
Sets the model's selected index to index. Notifies any listeners if the model changes

param
index an int specifying the model selection
see
#getSelectedIndex
see
#addChangeListener