Basic HTML version of Foils prepared 19 July 97

Foil 22 Event Model in Java 1.0

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


All events are represented by the Event class. The instance variable, id, represents the type of the event, such as a button click. Another instance variable, target, specifies the object which generated the event, such as which button.
Events are dispatched first to the handleEvent() method of the Component in which they occurred. If possible, this method will pass the event on to an appropriate specific event handler such as action(), mouseDown(), etc.
If the event handler returns true, it handled the event and it's over. Otherwise, handleEvent passes the event on to the container in which that component resides, and so on.



© 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