Basic HTML version of Foils prepared March 26 1999

Foil 4 Button

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


1 Adding a button to the applet is just as easy: Button button1 = new Button ( " Blue " ) ; add ( button1 ) ;
2 These statements add a button labelled Blue.
3 But nothing will happen when you press the button!
4 Pressing the button is called an event. You must add a "handler" method that is executed when a button event occurs.
5 A button event is a type of event called an ActionEvent in Java.

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