1import java.applet.Applet;
2import java.awt.*;
3
4
5
6public
7class ParamTest extends Applet {
8
9 private
10 String p1 = "???", p2 = "!!!";
11
12 public
13 void init() {
14 p1 = getParameter("dieAntwort");
15 p2 = getParameter("dieFrage");
16 }
17
18
19
20 public
21 void paint( Graphics g ) {
22 setBackground(Color.pink);
23 g.drawString(p1 + " " + p2, 25, 25);
24
25 g.drawString("CodeBase:", 25, 45);
26 g.drawString(getCodeBase().toString(), 25, 65);
27
28 g.drawString("DocumentBase:", 25, 85);
29 g.drawString(getDocumentBase().toString(), 25,105);
30
31 showStatus("Applet painted");
32 }
33
34
35
36 public
37 String getAppletInfo() {
38 return "ParamTest.java";
39 }
40
41
42
43 public
44 String [][] getParameterInfo() {
45 String [][] info = {
46 {"dieAntwort", "ein String", "eine Antwort"},
47 {"dieFrage" , "ein String", "eine Frage" }
48 };
49 return info;
50 }
51}
52
53