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