Basic HTML version of Foils prepared 13 July 98

Foil 70 The actionPerformed Method

From Java Academy II:Intermediate Java NPAC/ECS Java Academy -- February to April 98. by Tom Scavo


Our test applet has three buttons
The actionPerformed(...) method determines which button was pressed : public void actionPerformed(ActionEvent e) { String label = e.getActionCommand(); if ( label.equals( "Red" ) {...} else if ( label.equals( "White" ) {...} else if ( label.equals( "Blue" ) {...} ... }



© 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 Sat Nov 28 1998