// .html
-------------------------------------------------------
<applet code="MyApplet.class"
codebase="./"
archive="MyApplet.jar"
width="600" height="95">
<param name="strColor" value="FFFFFF">
Your browser is completely ignoring the <APPLET> tag!
</applet>// .java
-------------------------------------------------------
class MyApplet extends Applet {
..
public void init() {
String color = getParameter("strColor");
// color will be set to "FFFFFF"
...
} ...
}
-------------------------------------------------------
<applet code="MyApplet.class"
codebase="./"
archive="MyApplet.jar"
width="600" height="95">
<param name="strColor" value="FFFFFF">
Your browser is completely ignoring the <APPLET> tag!
</applet>// .java
-------------------------------------------------------
class MyApplet extends Applet {
..
public void init() {
String color = getParameter("strColor");
// color will be set to "FFFFFF"
...
} ...
}
... public void init() {
String color = getParameter("strColor");
JLabel label = new JLabel("HELLO!");
label.setHorizontalAlignment(JLabel.CENTER);
label.setBorder(BorderFactory.createMatteBorder(1,1,2,2,Color.black));
label.setBackground(Color.decode(color));
getContentPane().add(label, BorderLayout.CENTER);
} ...
}