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. |