public interface SingleSelectionModel
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(ChangeListener listener)
Adds listener as a listener to changes in the model.
|
void |
clearSelection()
Clears the selection (to -1).
|
int |
getSelectedIndex()
Returns the model's selection.
|
boolean |
isSelected()
Returns true if the selection model currently has a selected value.
|
void |
removeChangeListener(ChangeListener listener)
Removes listener as a listener to changes in the model.
|
void |
setSelectedIndex(int index)
Sets the model's selected index to index.
|
int getSelectedIndex()
setSelectedIndex(int)
void setSelectedIndex(int index)
index
- an int specifying the model selectiongetSelectedIndex()
,
addChangeListener(javax.swing.event.ChangeListener)
void clearSelection()
boolean isSelected()
void addChangeListener(ChangeListener listener)
listener
- the ChangeListener to addvoid removeChangeListener(ChangeListener listener)
listener
- the ChangeListener to remove Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2024, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.