Insert Java Applet

A Java Applet is a mini-application (that is how it gets its name) which allows for the execution of a particular effect inside an HTML document. Many of the scrolling menus that you see in the Web are generated by a Java Applet.

This small program is external to the HTML page and bears the .class extension.

There may be other external Files, for example an HTML page used by the program or images.

This command lets you insert in your document a predefined Java Applet from CuteHTML Pro or an external Java Applet.

CuteHTML Pro lets you insert an external Applet.

The following is an example of a Java Applet.

<applet codebase="http://asite" code="afile" alt="atext" name="aname" align="analignement" width="avalue" height="avalue">
<param name="applicationattribute1" value=
"avalue">
<param name="applicationattribute2" value=
"avalue">

  <param name="applicationattribute3" value="avalue">
</applet>

First you must copy the necessary files in your site’s directory.

  1. Save your HTML document.

  2. From the Specialized tab, click on the button Insert a Java Applet.

  3. In the Code, area, enter the name of the file that contains the applet. This file must have a relative address. The address cannot be absolute.

  4. In the Code Base URL, you can enter the path for the folder counting the Java Applet. This is not necessary if the .class file is found in the same folder. If this attribute is not indicated, the current document’s URL will be used.

  5. In the Alternative text area you can insert a message that will be displayed before the applet is loaded or if the browser the visitor is using cannot display it. This is an optional attribute.

  6. In the Name area, you can enter the name of the applet. This allows the applet to communicate with other scripts found on the same page. This is an optional attribute.

  7. In the Alignment area, indicates the Applet’s alignment. This option is mandatory. By default, the alignment is centered.

  8. If the MayScript (JavaScript Access) option is enabled, the applet has access to JavaScripts found on the same HTML document. This option is exclusive to Netscape.

  9. In the Width and Height area, indicate the size in pixels for the Applet. These values are mandatory.

  10. In the Vertical Space and Horizontal Space you can indicate the space between text and the applet. This value is optional.

  11. Click on the Parameters tab to modify the parameters and enter their corresponding values.

  12. You can click on the Preview button to obtain a preview of the applet.

  13. Click on OK.

The properties of an applet can be changed.

Java Applet parameters

The Java Applet parameters are constituted by two HTML tags: PARAM NAME and VALUE, the first being the parameter named, for example the positioning of an item within a menu or the font used, the second is its value, for example the wording of an item in a menu or the font size.

For example:

<param name="home" value="index.html">

Or

<param name="fontsize" value="18">

To add a new parameter:

  1. Edit the Applet’s tag.

  2. In the dialog box Predefined Applets, click on the Parameters tab.

  3. In the text box Name, type the name of the parameter to be changed.
    You can refer to the list of parameters listed to see the names of the parameters you can use.

  4. In the text box Value, define the value for the parameter.
    You can refer again to the parameters list to see the corresponding values.
    Once the preceding elements are defined (parameter and value), the Add button will be activated.

  5. Click on the Add button to add the new parameter to the list.
    The new parameter will be added to the bottom of the list. You can reorganize the order of the parameters by using the keys.

To change an existing parameter:

  1. Edit the Applet’s tag.

  2. In the dialog box Predefined Applets, click on the Parameters tab.

  3. Select the parameter to be changed in the list.

  4. Click on the Edit button.
    You can also use the context menu or double click on the parameter to be changed.

  5. Select the option which is appropriate to the type of change:

  1. Click on OK.