Basic HTML version of Foils prepared March 26 1999

Foil 6 Handling Button Events

From Java Academy:Graphical User Interface NPAC Java Academy February--April 99 -- March 1999. by Nancy McCracken

Applet to show button events
1 The last step is to connect the button to the actionPerformed method by registering that the applet is the class ready to "listen" for button events: button1.addActionListener ( this ) ;
2 The keyword this refers to the current applet.
3 Note that many buttons can add ActionListener and the one actionPerformed method should have code sections for each button.
4

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 Fri Mar 26 1999