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

public Class ListDataEvent

extends EventObject
Class Inheritance
Annotations
@SuppressWarnings:serial
Imports
java.util.EventObject

Defines an event that encapsulates changes to a list.

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.

Author
Hans Muller

Field Summary

Modifier and TypeField and Description
public static final int
CONTENTS_CHANGED

Identifies one or more changes in the lists contents.

private int
private int
public static final int
INTERVAL_ADDED

Identifies the addition of one or more contiguous items to the list

public static final int
INTERVAL_REMOVED

Identifies the removal of one or more contiguous items from the list

private int
Inherited from java.util.EventObject:
source

Constructor Summary

AccessConstructor and Description
public
ListDataEvent(Object
the source Object (typically this)
source
,
int type, int
one end of the new interval
index0
,
int
the other end of the new interval
index1
)

Constructs a ListDataEvent object.

Method Summary

Modifier and TypeMethod and Description
public int

Returns:

an int representing the lower index value
getIndex0
()

Returns the lower index of the range.

public int

Returns:

an int representing the upper index value
getIndex1
()

Returns the upper index of the range.

public int

Returns:

an int representing the type value
getType
()

Returns the event type.

public String

Returns:

a string representation of this ListDataEvent.
toString
()

Overrides java.util.EventObject.toString.

Returns a string representation of this ListDataEvent.

Inherited from java.util.EventObject:
getSource

Field Detail

CONTENTS_CHANGEDback to summary
public static final int CONTENTS_CHANGED

Identifies one or more changes in the lists contents.

index0back to summary
private int index0
index1back to summary
private int index1
INTERVAL_ADDEDback to summary
public static final int INTERVAL_ADDED

Identifies the addition of one or more contiguous items to the list

INTERVAL_REMOVEDback to summary
public static final int INTERVAL_REMOVED

Identifies the removal of one or more contiguous items from the list

typeback to summary
private int type

Constructor Detail

ListDataEventback to summary
public ListDataEvent(Object source, int type, int index0, int index1)

Constructs a ListDataEvent object. If index0 is > index1, index0 and index1 will be swapped such that index0 will always be <= index1.

Parameters
source:Object

the source Object (typically this)

type:int

an int specifying CONTENTS_CHANGED, INTERVAL_ADDED, or INTERVAL_REMOVED

index0:int

one end of the new interval

index1:int

the other end of the new interval

Method Detail

getIndex0back to summary
public int getIndex0()

Returns the lower index of the range. For a single element, this value is the same as that returned by getIndex1.

Returns:int

an int representing the lower index value

getIndex1back to summary
public int getIndex1()

Returns the upper index of the range. For a single element, this value is the same as that returned by getIndex0.

Returns:int

an int representing the upper index value

getTypeback to summary
public int getType()

Returns the event type. The possible values are:

Returns:int

an int representing the type value

toStringback to summary
public String toString()

Overrides java.util.EventObject.toString.

Returns a string representation of this ListDataEvent. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Returns:String

a string representation of this ListDataEvent.

Since
1.4