Setting applet parameters

About this task

Some Java applets have parameters that use default values. You do not need to specify values for these parameters. For applets that have parameters without default values, however, you must set parameter values or the applet will not run. You can manually enter parameters and values, or you can paste all of the parameters in the Programmer's pane and edit associated values.

To set individual applet parameters

Procedure

  1. Select the Java applet and, if the Programmer's pane is not displayed, choose Java Applet - Java Applet Parameters.
  2. Click "Applet Parameters" in the Programmer's pane.
  3. Use any text editor and open the HTML file associated with the Java applet.
    • If you imported the applet, check the HTML file on your file system.
    • If you linked the applet, use a Web browser and check the HTML file on the Web.
  4. Click Add.
  5. Enter the parameter name. For example, enter bgcolor for the following HTML tag:
    <param name=bgcolor value="black">
  6. Enter the corresponding value in the Parameter Value window. For example, enter black for the example HTML tag in Step 5.

To set all applet parameters

Procedure

  1. Use any text editor or Web browser and open the HTML file associated with the Java applet.
  2. In the HTML file, select all of the parameters and copy them to the Clipboard. For example, copy all of the following text:
    <param name=bgcolor value="black">
    <param name=fgcolor1 value="red">
    <param name=fgcolor2 value="magenta">
  3. Select the Java applet and if the Programmer's pane is not displayed, choose Java Applet - Java Applet Parameters.
  4. Click "Applet Parameters."
  5. Click Paste to add the parameters and their values.

Tips

About this task

  • To change a parameter value, click its name in the Programmer's pane. Then change its value in the Parameter value window.
  • The parameter value is a formula; therefore, you must enclose text values in double quotes. In addition to text strings, a parameter value can be an @function or a field name.
  • If you are running an applet through a browser, you can add JavaScript to a form or document to interact with the applet by calling its public methods or setting/getting its public properties.