java.util

Class EventObject

public class EventObject extends Object implements Serializable

Represents Events fired by Objects.

Since: 1.1

See Also: EventListener

UNKNOWN: updated to 1.4

Field Summary
protected Objectsource
The source object; in other words, the object which this event takes place on.
Constructor Summary
EventObject(Object source)
Constructs an EventObject with the specified source.
Method Summary
ObjectgetSource()
Returns the source of the event.
StringtoString()
Converts the event to a String.

Field Detail

source

protected transient Object source
The source object; in other words, the object which this event takes place on.

Constructor Detail

EventObject

public EventObject(Object source)
Constructs an EventObject with the specified source.

Parameters: source the source of the event

Throws: IllegalArgumentException if source is null (This is not specified, but matches the behavior of the JDK)

Method Detail

getSource

public Object getSource()
Returns the source of the event.

Returns: the event source

toString

public String toString()
Converts the event to a String. The format is not specified, but by observation, the JDK uses: getClass().getName() + "[source=" + source + "]";.

Returns: String representation of the Event