Basic HTML version of Foils prepared 19 July 97

Foil 24 Event Objects

From Overview of JDK Version 1.1 Extensions CPS616 -- Information Track of CPS -- Spring Semester 97. by Nancy J. McCracken


new class java.awt.EventObject is parent of all events, including those for AWT, java.awt.AWTEvent.
Every event has a source object, obtained by getSource() and a type value, obtained by getID().
  • For example, FocusEvent has two types: FocusEvent.FOCUS_GAINED and FocusEvent.FOCUS_LOST.
Event subclasses also have methods for whatever data is needed to handle the event.
  • For example, MouseEvent has getX(), getY(), and getClickCount(), also inherits getModifiers(), and getWhen()



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Nov 29 1998