1import java.applet.Applet;
2import java.awt.*;
3import java.awt.event.*;
4
5public
6class ButtonApplet3 extends Applet {
7
8 TextArea t;
9 Button b;
10
11 public
12 void init () {
13 t = new TextArea("",6,40,TextArea.SCROLLBARS_VERTICAL_ONLY);
14 b = new Button("druecke mich");
15
16 b.addActionListener(new ButtonPressListener());
17
18 add(t);
19 add(b);
20 }
21
22
23
24
25 class ButtonPressListener
26 implements ActionListener
27 {
28 public
29 void actionPerformed(ActionEvent e) {
30 t.append("autsch!!!\n");
31 }
32 }
33}
34
35