Hello with Parameters
/* Hello World Applet with
parameters */ |
The getParameter line accepts the parameter from the HTML code. The 'name' variable is then concatenated with "Hello" and it is ready for execution. |
The HTML code to place the applet on a page and send it parameters is given below.
<p><applet code="Hellojoe.class" width="400" height="60">
<param name="name" value="Joe from Kokomo"></applet></p>
The applet window will be 400 X 60 pixels and it will accept "Joe from Kokomo" as the name parameter. The output is shown below.