1import java.applet.*;
2import java.awt.*;
3
4public
5class SimpleText extends Applet {
6
7 TextField f;
8
9
10
11 public
12 void init() {
13
14 f = new TextField();
15 f.setEditable(false);
16
17 setLayout(new GridLayout(1,0));
18
19 add(f);
20 validate();
21
22 write("init");
23 }
24
25
26
27 public
28 void start() {
29 write("start");
30 }
31
32
33
34 public
35 void stop() {
36 write("stop");
37 }
38
39
40
41 public
42 void destroy() {
43 write("destroy");
44 }
45
46
47
48 void write(String s) {
49 System.out.println(s);
50
51 f.setText(f.getText() + " " + s);
52 repaint();
53 }
54}
55
56
57