public interface javax.swing
SingleSelectionModel


Show All Login
Java SE 6
  
Implemented by: DefaultSingleSelectionModel
Details
A model that supports at most one indexed selection.
version1.20 11/17/05

Methods
public void addChangeListener(ChangeListener listener) Details
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) Details
Removes listener as a listener to changes in the model.
listenerthe ChangeListener to remove

Properties
public boolean isSelected() Details
Returns true if the selection model currently has a selected value.
returntrue if a value is currently selected
public void setSelectedIndex(int index) Details
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() Details
Returns the model's selection.
returnthe model's selection, or -1 if there is no selection
See also setSelectedIndex