Creating Shared Applets

The shared applet resource provides a storage area within an application for an applet and all its related files. When this is added to the database, you can reference the shared applet from multiple agents in the database. It also makes it easy to create applets in a template file and apply those elements to multiple databases.

You can create a shared applet resource from the Design pane for applets. The New Applet Resource button provides the ability to locate the Java applet files in a dialog box, as shown in Figure 7.11. This dialog box operates in the same way as the Define Java Agent Files dialog box, in that it is accessed from the Agent design screen when importing a Java applet. This is covered in detail in Chapter 18, "Writing Java for Domino Applications." After the files have been selected, a name must be entered for the applet resource. Domino then creates the entry for the shared applet resource by making it available in the Work pane.

Figure 7.11. Files can be selected from the Locate Java Applet Files dialog box.

A shared applet resource can be refreshed after modifying the applet and also can be exported. Use the Refresh button to refresh the applet, and use the Export button to export (save a copy of) the applet to your computer.

To insert the applet files using the applet resource in a form, page, subform, or rich-text field, choose Create, Java Applet from the menu bar. Choose the Locate button to invoke the Locate Java Applet Files dialog box to select the applet and add it to the form, page, subform, or rich-text field.

Категории