javax.swing.event

Class ListSelectionEvent

public class ListSelectionEvent extends EventObject

An event that indicates a change to a list selection, including the source of the change (a {@link ListSelectionModel}) and the range of items in the list that have potentially changed their selection status.
Constructor Summary
ListSelectionEvent(Object source, int firstIndex, int lastIndex, boolean isAdjusting)
Creates a new ListSelectionEvent.
Method Summary
intgetFirstIndex()
Returns the first index.
intgetLastIndex()
Returns the last index.
booleangetValueIsAdjusting()
Returns the flag that indicates that this event is one in a series of events updating a selection.
StringtoString()
Returns a string representation of the event, typically used for debugging purposes.

Constructor Detail

ListSelectionEvent

public ListSelectionEvent(Object source, int firstIndex, int lastIndex, boolean isAdjusting)
Creates a new ListSelectionEvent.

Parameters: source the event source (null not permitted). firstIndex the first index. lastIndex the last index. isAdjusting a flag indicating that this event is one in a series of events updating a selection.

Throws: IllegalArgumentException if source is null.

Method Detail

getFirstIndex

public int getFirstIndex()
Returns the first index.

Returns: The first index.

getLastIndex

public int getLastIndex()
Returns the last index.

Returns: The last index.

getValueIsAdjusting

public boolean getValueIsAdjusting()
Returns the flag that indicates that this event is one in a series of events updating a selection.

Returns: A boolean.

toString

public String toString()
Returns a string representation of the event, typically used for debugging purposes.

Returns: A string representation of the event.