Sending Parameters from a Web Page

The functionality of an applet can be customized with the use of parameters, settings stored in HTML markup that serve the same purpose as command-line arguments in applications.

Parameters are stored as part of the web page that contains an applet. They’re created using the HTML tag param and its two attributes: name and value. You can have more than one param tag with an applet, but all must be placed between the opening <applet> and closing </applet> tags. Here’s an applet tag that includes several parameters:

<applet code="ScrollingHeadline" height="50" width="400">    <param name="headline1" value="Dewey defeats Truman">    <param name="headline2" value="Stix nix hix pix">    <param name="headline3" value= ...

Get Sams Teach Yourself Java™ in 24 Hours, Sixth 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.