Name

EventObject

Synopsis

EventObject serves as the superclass for all event objects used by the event model introduced in Java 1.1 for AWT and JavaBeans and also used by Swing in Java 1.2. This class defines a generic type of event; it is extended by the more specific event classes in the java.awt, java.awt.event, java.beans, and javax.swing.event packages. The only common feature shared by all events is a source object, which is the object that, in some way, generated the event. The source object is passed to the EventObject( ) constructor and is returned by the getSource( ) method.

java.util.EventObject

Figure 16-19. java.util.EventObject

public class EventObject implements Serializable {
// Public Constructors
     public EventObject(Object source);  
// Public Instance Methods
     public Object getSource( );  
// Public Methods Overriding Object
     public String toString( );  
// Protected Instance Fields
     protected transient Object source;  
}

Subclasses

java.util.prefs.NodeChangeEvent, java.util.prefs.PreferenceChangeEvent, javax.net.ssl.HandshakeCompletedEvent, javax.net.ssl.SSLSessionBindingEvent

Get Java in a Nutshell, 5th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.