APIdia Launch Partner
Top Description Fields Constructors Methods
javax.swing.event

public Class ListSelectionEvent

extends EventObject
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.util.EventObject, javax.swing.ListSelectionModel

An event that characterizes a change in selection. The change is limited to a single inclusive interval. The selection of at least one index within the range will have changed. A decent ListSelectionModel implementation will keep the range as small as possible. ListSelectionListeners will generally query the source of the event for the new selected status of each potentially changed row.

Warning

Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeans has been added to the java.beans package. Please see java.beans.XMLEncoder.

Authors
Hans Muller, Ray Ryan
See Also
ListSelectionModel

Field Summary

Modifier and TypeField and Description
private final int
private final boolean
private final int
Inherited from java.util.EventObject:
source

Constructor Summary

AccessConstructor and Description
public
ListSelectionEvent(Object
the Object on which the event initially occurred
source
,
int
the first index in the range, <= lastIndex
firstIndex
,
int
the last index in the range, >= firstIndex
lastIndex
,
boolean
whether or not this is one in a series of multiple events, where changes are still being made
isAdjusting
)

Represents a change in selection status between firstIndex and lastIndex, inclusive.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

the first row whose selection value may have changed, where zero is the first row
getFirstIndex
()

Returns the index of the first row whose selection may have changed.

public int

Returns:

the last row whose selection value may have changed, where zero is the first row
getLastIndex
()

Returns the index of the last row whose selection may have changed.

public boolean

Returns:

true if this is one in a series of multiple events, where changes are still being made
getValueIsAdjusting
()

Returns whether or not this is one in a series of multiple events, where changes are still being made.

public String

Returns:

a string representation of this object
toString
()

Overrides java.util.EventObject.toString.

Returns a String that displays and identifies this object's properties.

Inherited from java.util.EventObject:
getSource

Field Detail

firstIndexback to summary
private final int firstIndex
isAdjustingback to summary
private final boolean isAdjusting
lastIndexback to summary
private final int lastIndex

Constructor Detail

ListSelectionEventback to summary
public ListSelectionEvent(Object source, int firstIndex, int lastIndex, boolean isAdjusting)

Represents a change in selection status between firstIndex and lastIndex, inclusive. firstIndex is less than or equal to lastIndex. The selection of at least one index within the range will have changed.

Parameters
source:Object

the Object on which the event initially occurred

firstIndex:int

the first index in the range, <= lastIndex

lastIndex:int

the last index in the range, >= firstIndex

isAdjusting:boolean

whether or not this is one in a series of multiple events, where changes are still being made

Method Detail

getFirstIndexback to summary
public int getFirstIndex()

Returns the index of the first row whose selection may have changed. getFirstIndex() <= getLastIndex()

Returns:int

the first row whose selection value may have changed, where zero is the first row

getLastIndexback to summary
public int getLastIndex()

Returns the index of the last row whose selection may have changed. getLastIndex() >= getFirstIndex()

Returns:int

the last row whose selection value may have changed, where zero is the first row

getValueIsAdjustingback to summary
public boolean getValueIsAdjusting()

Returns whether or not this is one in a series of multiple events, where changes are still being made. See the documentation for javax.swing.ListSelectionModel#setValueIsAdjusting for more details on how this is used.

Returns:boolean

true if this is one in a series of multiple events, where changes are still being made

toStringback to summary
public String toString()

Overrides java.util.EventObject.toString.

Returns a String that displays and identifies this object's properties.

Returns:String

a string representation of this object