Adding Java applets (Web Publishing mode only)

Java is a cross-platform, object-oriented programming language used to create mini-applications called applets that can be attached to web pages and that run when the page is viewed in a web browser. PagePlus lets you add Java applets to your web publications. You don’t have to write your own! Plenty of applets are available online—for example animation, interface components, live information updating, two-way interaction, and many more.

Downloaded applets typically consist of a main “.class” file and one or more associated files (such as other .class files, picture files, media files, etc.). Again, you don’t need to understand the underlying code, but it’s essential to make sense of any “Read Me” documentation that comes with the applet. When using PagePlus to embed an applet, you must list its component files as well as any necessary parameters (as described in the applet’s documentation) that specify exactly how the applet should run.

When adding a Java applet in PagePlus, you have the option of embedding its files in your publication, as opposed to keeping them separate. Although embedding any file adds to the size of the publication, it is the default option because you’ll no longer have to worry about juggling separate files or the chance of accidentally deleting one of them. When you publish your site, PagePlus takes care of exporting and copying both embedded and non-embedded files.

Bear in mind that Java applets won’t execute instantly in a visitor’s browser. As with image or media files, it will take time to download the applet files to the user’s computer before anything “happens” on screen. Take the combined applet file sizes into account when figuring the time it will take the web page to display.

PagePlus inserts a marker into your publication at the place where the applet will appear on your web page. You can’t actually see the applet running until you preview the exported site. The marker’s dimensions probably won’t correspond exactly to those of the applet when it’s running, so plan your page layout accordingly. Also, bear in mind that a Java applet’s user interface may look slightly different on each browser that displays it, even on the same operating system. The more preview tests you can run, for example using both Firefox and Microsoft Internet Explorer, the better.

To add a Java applet to a page:

  1. Choose Web Object… from the Insert menu and select Java Applet… from the submenu.

  2. In the dialog, click Browse… to locate the Applet Class File.

  3. Click the upper Add.. button to locate any other files required by the applet. You can hold down the Ctrl or Shift key to select multiple files in the dialog. To delete a file once you’ve added it to your list, click the file name and then click the Delete button.

  4. If you do not wish to embed the files in your publication, uncheck the “Embed” option.

  5. Click the lower Add… button to enter any required parameters (see documentation supplied with the Java applet). Add parameters one at a time, typing the Name and Value (excluding quotation marks) in the fields provided. To delete a parameter from the list (for example if you typed it wrong), click the Up or Down buttons to select the parameter, then click the Delete button below the list.
    Note:
    When you publish your site, PagePlus will export and copy both embedded and non-embedded files into a common folder along with the HTML pages and graphics. Keep this in mind when entering file paths. If the applet’s documentation insists on certain components being placed into separate subdirectories, you’ll need to place them there “by hand” using an FTP utility.

  6. Click OK to close the dialog, then click (or click and drag) with the cursor to place the Java marker on your page.

Adding Java applets