public interface javax.swing
SingleSelectionModel


Hide details Login
Java SE 6
  
Implemented by: DefaultSingleSelectionModel

A model that supports at most one indexed selection.
version1.20 11/17/05

Methods
public void addChangeListener(ChangeListener listener)
Adds listener as a listener to changes in the model.
listenerthe ChangeListener to add
public void clearSelection()
Clears the selection (to -1).
public void removeChangeListener(ChangeListener listener)
Removes listener as a listener to changes in the model.
listenerthe ChangeListener to remove

Properties
public boolean isSelected()
Returns true if the selection model currently has a selected value.
returntrue if a value is currently selected
public void setSelectedIndex(int index)
Sets the model's selected index to index. Notifies any listeners if the model changes
indexan int specifying the model selection
See also getSelectedIndex, addChangeListener
public int getSelectedIndex()
Returns the model's selection.
returnthe model's selection, or -1 if there is no selection
See also setSelectedIndex