Basic HTML version of Foils prepared July 6 99

Foil 43 Event Model - II

From Use of Java Language in Computational Science DoD Modernization Users Group Conference Monterey -- June 7 99. by Nancy McCracken, Geoffrey C. Fox


1 The event source notifies event listeners by invoking a particular method of the event listener (aka the event handler method) and passing it an Event object, which has all the information about the event.
  • public class EventClass implements ActionListener
  • {
  • public void actionPerformed ( ActionEvent ev )
  • {. . . put code here to respond to event ev . . . }
  • }
2 Each basic component has a defined Event class, Listener interface, and event handling method names.
3 Note that an interface is a class in which there are headers of methods with no method body. It just gives the name(s) of methods such as actionPerformed that the user is to provide.

in Table To:


© 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 Tue Jul 6 1999