public interface ListSelectionModel
extends java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static int |
MULTIPLE_SELECTION |
static int |
SINGLE_SELECTION |
| Modifier and Type | Method and Description |
|---|---|
void |
addChangeListener(ChangeListener l)
Adds a
ChangeListenerb to the selection model, which will
be notified when the selection changes. |
void |
clearSelection()
Deselects all items.
|
int |
getMaxSelectedIndex()
Returns the maximum selected index.
|
int |
getMinSelectedIndex()
Returns the minimum selected index.
|
int |
getSelectionMode()
Returns the selection mode.
|
boolean |
isSelectedIndex(int index)
Determines whether an index is selected.
|
boolean |
isSelectionEmpty()
Determines if no items are selected.
|
void |
removeChangeListener(ChangeListener l)
Removes a
ChangeListener from being notified of when the
selection changes. |
void |
setSelectedIndex(int index,
boolean selected)
Sets the selection state of the given index.
|
void |
setSelectionMode(int selectionMode)
Sets the selection mode.
|
static final int SINGLE_SELECTION
static final int MULTIPLE_SELECTION
void addChangeListener(ChangeListener l)
ChangeListenerb to the selection model, which will
be notified when the selection changes.l - the ChangeListener to addvoid clearSelection()
int getMaxSelectedIndex()
int getMinSelectedIndex()
int getSelectionMode()
ListSelectionModel.SINGLE_SELECTION: only
one list element may be selected.ListSelectionModel.MULTIPLE_SELECTION:
multiple list elements may be selected.boolean isSelectedIndex(int index)
index - the indexboolean isSelectionEmpty()
void removeChangeListener(ChangeListener l)
ChangeListener from being notified of when the
selection changes.l - the ChangeListener to removevoid setSelectedIndex(int index,
boolean selected)
index - the indexselected - the new selection statevoid setSelectionMode(int selectionMode)
selectionMode - the selection mode, one of the following values:
ListSelectionModel.SINGLE_SELECTION: only one list element
may be selected.ListSelectionModel.MULTIPLE_SELECTION: multiple list elements
may be selected.