1import java.applet.Applet;
2import java.awt.Frame;
3
4public
5class FrameApplet extends Applet {
6
7 Frame f;
8 int width = 400;
9 int height = 300;
10
11 public
12 void init () {
13 width = getIntParameter("frameWidth", width );
14 height = getIntParameter("frameHeight",height);
15
16 f = new Frame("Frame Demo");
17 f.setSize(width,height);
18 }
19
20 public
21 void start() {
22 f.show();
23 f.validate();
24 }
25
26 public
27 void stop() {
28 f.dispose();
29 }
30
31
32
33 int getIntParameter(String param,
34 int defaultValue) {
35 int res = defaultValue;
36
37 try {
38 res = Integer.parseInt(getParameter(param));
39 } catch (Exception e) { }
40
41 return res;
42 }
43}
44
45