Inserting a Java Bean Component

From Documentation
Jump to: navigation, search

Inserting a Java Bean Component

Java Beans are a type of Java applet. Unlike Java applets, which require .class files plus other types of files, Java Beans are an all-in-one implementation of Java. A single .jar file contains everything required to run the applet.

To insert a Java Bean:

  1. In Page view, select the Java Bean tool from the Plug-Ins toolbar.
  2. Draw a box to indicate the position of the Java Bean.

The Open dialog appears.

  1. Select a Java Bean file from the NetObjects\NetObjects Fusion\Java\Beans folder, or select one that is currently use in the site from the Java Archive Assets tab.

A Java Bean file can have a .jar or .class extension. Most Java Beans have a .jar extension, but some .jar files might not be Java Beans. If you try to open a .jar file that is not a bean, you see a message from NetObjects Fusion.

  1. Click Open.

The Java Bean placeholder appears on the page. Beans have different icons in the upper right corner of the placeholder; the icon is created by the bean's author and has no effect on the bean or its behavior. The path to the file you selected appears in the File field on the Properties tab of the Java Bean Properties panel. To select a different file, click Browse, find the file, and click Open. The current .class file is displayed in the Class field.

  1. To provide text for the browser to display if it cannot display the file, enter a description in the AltTag field.
  2. Select Applet or Servlet depending on the type of bean you are inserting.
  3. If the bean requires other files, click the Additional Files button, then click Add in the Java Applet Files dialog.
  4. Select another file in the Add Java Applet Files dialog, and click Open. Click OK to add the selected file.
  5. Display the Properties tab.

Different beans have different sets of properties. This help assumes you are familiar with Java Beans and understand the effects of setting these properties. In some cases, Java Bean developers provide documentation that explains the properties.

  1. To edit a property, select the appropriate field. Some properties require you to choose a color or enter a value in a dialog. Other properties toggle True/False or require you to type text. In some cases properties appear that have no affect on the bean or its behavior.
  2. Click the Parameters tab.

If you know the bean's internal parameters, you can add or remove them.

  • To add a parameter, click the plus (+) button and enter a name and value in the Enter Value dialog.
  • If there are parameters listed, to remove one, select it and click the minus (-) button.
  • To change the order of the listed parameters, select a parameter and click the Up or Down arrow buttons.
  1. Publish the page to see how the bean works.

You can add actions to Java Beans using the Actions tab. When you choose a Java Bean as the target or source of an action, you see an expanded selection of available actions or trigger events as appropriate. See Building Dynamic Pages.