javax.swing.event
Class ListDataEvent

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by java.util.EventObject sample code for java.util.EventObject definition code for java.util.EventObject 
      extended by javax.swing.event.ListDataEvent
All Implemented Interfaces:
Serializable sample code for java.io.Serializable definition code for java.io.Serializable

public class ListDataEvent
extends EventObject sample code for java.util.EventObject definition code for 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 JavaBeansTM has been added to the java.beans package. Please see XMLEncoder sample code for java.beans.XMLEncoder definition code for java.beans.XMLEncoder .

See Also:
Serialized Form

Field Summary
static int CONTENTS_CHANGED sample code for javax.swing.event.ListDataEvent.CONTENTS_CHANGED definition code for javax.swing.event.ListDataEvent.CONTENTS_CHANGED
          Identifies one or more changes in the lists contents.
static int INTERVAL_ADDED sample code for javax.swing.event.ListDataEvent.INTERVAL_ADDED definition code for javax.swing.event.ListDataEvent.INTERVAL_ADDED
          Identifies the addition of one or more contiguous items to the list
static int INTERVAL_REMOVED sample code for javax.swing.event.ListDataEvent.INTERVAL_REMOVED definition code for javax.swing.event.ListDataEvent.INTERVAL_REMOVED
          Identifies the removal of one or more contiguous items from the list
 
Fields inherited from class java.util.EventObject sample code for java.util.EventObject definition code for java.util.EventObject
source sample code for java.util.EventObject.source definition code for java.util.EventObject.source
 
Constructor Summary
ListDataEvent sample code for javax.swing.event.ListDataEvent.ListDataEvent(java.lang.Object, int, int, int) definition code for javax.swing.event.ListDataEvent.ListDataEvent(java.lang.Object, int, int, int) (Object sample code for java.lang.Object definition code for java.lang.Object  source, int type, int index0, int index1)
          Constructs a ListDataEvent object.
 
Method Summary
 int getIndex0 sample code for javax.swing.event.ListDataEvent.getIndex0() definition code for javax.swing.event.ListDataEvent.getIndex0() ()
          Returns the lower index of the range.
 int getIndex1 sample code for javax.swing.event.ListDataEvent.getIndex1() definition code for javax.swing.event.ListDataEvent.getIndex1() ()
          Returns the upper index of the range.
 int getType sample code for javax.swing.event.ListDataEvent.getType() definition code for javax.swing.event.ListDataEvent.getType() ()
          Returns the event type.
 String sample code for java.lang.String definition code for java.lang.String toString sample code for javax.swing.event.ListDataEvent.toString() definition code for javax.swing.event.ListDataEvent.toString() ()
          Returns a string representation of this ListDataEvent.
 
Methods inherited from class java.util.EventObject sample code for java.util.EventObject definition code for java.util.EventObject
getSource sample code for java.util.EventObject.getSource() definition code for java.util.EventObject.getSource()
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Field Detail

CONTENTS_CHANGED sample code for javax.swing.event.ListDataEvent.CONTENTS_CHANGED

public static final int CONTENTS_CHANGED
Identifies one or more changes in the lists contents.

See Also:
Constant Field Values

INTERVAL_ADDED sample code for javax.swing.event.ListDataEvent.INTERVAL_ADDED

public static final int INTERVAL_ADDED
Identifies the addition of one or more contiguous items to the list

See Also:
Constant Field Values

INTERVAL_REMOVED sample code for javax.swing.event.ListDataEvent.INTERVAL_REMOVED

public static final int INTERVAL_REMOVED
Identifies the removal of one or more contiguous items from the list

See Also:
Constant Field Values
Constructor Detail

ListDataEvent sample code for javax.swing.event.ListDataEvent(java.lang.Object, int, int, int) definition code for javax.swing.event.ListDataEvent(java.lang.Object, int, int, int)

public ListDataEvent(Object sample code for java.lang.Object definition code for java.lang.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 - the source Object (typically this)
type - an int specifying CONTENTS_CHANGED sample code for javax.swing.event.ListDataEvent.CONTENTS_CHANGED definition code for javax.swing.event.ListDataEvent.CONTENTS_CHANGED , INTERVAL_ADDED sample code for javax.swing.event.ListDataEvent.INTERVAL_ADDED definition code for javax.swing.event.ListDataEvent.INTERVAL_ADDED , or INTERVAL_REMOVED sample code for javax.swing.event.ListDataEvent.INTERVAL_REMOVED definition code for javax.swing.event.ListDataEvent.INTERVAL_REMOVED
index0 - one end of the new interval
index1 - the other end of the new interval
Method Detail

getType sample code for javax.swing.event.ListDataEvent.getType() definition code for javax.swing.event.ListDataEvent.getType()

public int getType()
Returns the event type. The possible values are:

Returns:
an int representing the type value

getIndex0 sample code for javax.swing.event.ListDataEvent.getIndex0() definition code for javax.swing.event.ListDataEvent.getIndex0()

public int getIndex0()
Returns the lower index of the range. For a single element, this value is the same as that returned by getIndex1() sample code for javax.swing.event.ListDataEvent.getIndex1() definition code for javax.swing.event.ListDataEvent.getIndex1() .

Returns:
an int representing the lower index value

getIndex1 sample code for javax.swing.event.ListDataEvent.getIndex1() definition code for javax.swing.event.ListDataEvent.getIndex1()

public int getIndex1()
Returns the upper index of the range. For a single element, this value is the same as that returned by getIndex0() sample code for javax.swing.event.ListDataEvent.getIndex0() definition code for javax.swing.event.ListDataEvent.getIndex0() .

Returns:
an int representing the upper index value

toString sample code for javax.swing.event.ListDataEvent.toString() definition code for javax.swing.event.ListDataEvent.toString()

public String sample code for java.lang.String definition code for java.lang.String  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.

Overrides:
toString sample code for java.util.EventObject.toString() definition code for java.util.EventObject.toString() in class EventObject sample code for java.util.EventObject definition code for java.util.EventObject
Returns:
a string representation of this ListDataEvent.
Since:
1.4