9.7. Reading Applet Parameters

HTML Element:<PARAM NAME="..." VALUE="...">
 (No End Tag)
Attributes: NAME (required), VALUE (required)

An applet does not receive the String[] argument list that applications get in the main method. However, you can customize an applet by supplying information inside PARAM tags located between <APPLET ...> and </APPLET>. These parameters are declared as follows:

<PARAM NAME="Parameter Name" VALUE="Parameter Value">

The parameters are read from within an applet by getParameter ("Parameter Name"), which returns "Parameter Value" as a String, or null if the parameter is not found. Note that getParameter is case sensitive, but as with HTML in general, the PARAM, NAME, and VALUE element and attribute names themselves ...

Get Core Web Programming, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.