O'Reilly logo

Java, A Beginner’s Guide, 5th Edition by Herbert Schildt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Passing Parameters to Applets

You can pass parameters to your applet. To do so, use the PARAM attribute of the APPLET tag, specifying the parameter’s name and value. To retrieve a parameter, use the getParameter( ) method, defined by Applet. Its general form is shown here:

String getParameter(String paramName)

Here, paramName is the name of the parameter. It returns the value of the specified parameter in the form of a String object. Thus, for numeric and boolean values, you will need to convert their string representations into their internal formats. If the specified parameter cannot be found, null is returned. Therefore, be sure to confirm that the value returned by getParameter( ) is valid. Also, check any parameter that is converted into ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required