This documentation differs from the official API.
Jadeite adds
extra features to the API including:
variable font sizes,
constructions examples,
placeholders for classes and methods, and auto-generated “See Also” links.
Additionally it
is missing some items found in standard Javadoc documentation, including:
generics type information,
“Deprecated” tags and comments,
“See Also” links,
along with other minor differences.
Please send any questions or feedback to
bam@cs.cmu.edu.
javax.swing
interface SingleSelectionModel
- All Known Implementing Classes:
- DefaultSingleSelectionModel
-
Most common way to construct:
-
ChangeEvent e = …;
SingleSelectionModel model = (SingleSelectionModel)e.getSource();
Based on 14 examples
public interface SingleSelectionModel
A model that supports at most one indexed selection.
Method Summary |
void |
Adds listener as a listener to changes in the model.
|
void |
Clears the selection (to -1).
|
int |
Returns the model's selection.
|
boolean |
Returns true if the selection model currently has a selected value.
|
void |
Removes listener as a listener to changes in the model.
|
void |
Sets the model's selected index to index.
|
addChangeListener
public void addChangeListener(ChangeListener listener)
-
Adds listener as a listener to changes in the model.
- Parameters:
listener
- the ChangeListener to add
clearSelection
public void clearSelection()
-
Clears the selection (to -1).
getSelectedIndex
public int getSelectedIndex()
-
Returns the model's selection.
- Returns:
- the model's selection, or -1 if there is no selection
isSelected
public boolean isSelected()
-
Returns true if the selection model currently has a selected value.
- Returns:
- true if a value is currently selected
removeChangeListener
public void removeChangeListener(ChangeListener listener)
-
Removes listener as a listener to changes in the model.
- Parameters:
listener
- the ChangeListener to remove
setSelectedIndex
public void setSelectedIndex(int index)
-
Sets the model's selected index to index.
Notifies any listeners if the model changes
- Parameters:
index
- an int specifying the model selection
This documentation differs from the official API.
Jadeite adds
extra features to the API including:
variable font sizes,
constructions examples,
placeholders for classes and methods, and auto-generated “See Also” links.
Additionally it
is missing some items found in standard Javadoc documentation, including:
generics type information,
“Deprecated” tags and comments,
“See Also” links,
along with other minor differences.
Please send any questions or feedback to
bam@cs.cmu.edu.
This page displays the
Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
The official Sun™ documentation can be found here at
http://java.sun.com/javase/6/docs/api/.