Managing the component palette

To use a class as a UI component in JBuilder's designers, it must be installed on the component palette. JBuilder comes with several groups of components pre-installed on different pages of the component palette or selected with the Bean Chooser  BeanChooserIcon.gif - 1025 Bytes. You can add components to the existing pages, or create new pages for them.

You might want to install additional components delivered with JBuilder, components you created yourself, or third-party components. The following sections explain how to install additional components and pages on the palette, delete unused ones, and customize the palette.

Adding a component to the component palette

If your component is a JavaBean, you can add it to the component palette.

If the component is to be shared between projects, it should be added to a library that is on the CLASSPATH in each project where it will be used.

To place the component on the component palette,

  1. Choose Tools|Configure Palette, or right-click a palette tab and choose Properties to display the Palette Properties dialog box.
  2. Select the Pages tab. In the Pages column, select the palette page on which you want your component to appear, or click the Add button to create a new page.

    Palette properties - Pages

  3. Click the Add Components tab to select a class or package name.

    Palette properties - Add From Package

  4. Press the Select Library button to open the Select A Different Library dialog box. Select an existing library from the list or create a new one by pressing New and using the New Library wizard. Click OK to close the dialog box.

    Palette properties - Create

  5. Select the palette page to which you want the components added, then click Install to open the Browse for Class dialog.

  6. Select the individual classes you want from the Browse for Class dialog, then click OK.

    Palette properties - Create

  7. Click OK to close the Palette Properties dialog box when you're finished, and commit your changes.

Using the Bean Chooser button

The Bean Chooser button BeanChooser Icon is located at the left edge of the component palette under the Selection Arrow. It displays a user-defined list of beans you can drop into your UI design. When you choose a bean from the list, the Bean Chooser loads your mouse cursor with a reference to the bean, just as if you had clicked a component on the palette. When you click the design surface, it adds the bean you chose.

To add a bean to the Bean Chooser drop-down list,

  1. Make sure the library that contains the bean is listed as a required library for your project in the Project Properties dialog box. If not, then add the library as follows:

    1. Choose Project|Properties to open the Project Properties dialog box.

      testep04d_std.gif

    2. Click the Required Libraries tab on the Paths page then, click the Add button.
    3. Select an existing library, or click the New button and add a new one to the list to choose. Click OK.

  2. Click the Bean Chooser button, and choose Select from the drop-down menu. This displays the Bean Chooser dialog box which contains a tree of all the available packages.

    beanchooser.gif

  3. Expand the desired node until you locate the bean you want. Select the bean and click OK.
  4. Click the Bean Chooser button again. Notice that a drop-down menu now appears containing the new Java Bean.
  5. To add another bean, click Select and repeat step 2 above.

Selecting an image for a component palette button

The image on a component palette button can be one of three things: To select the image for your component palette button,
  1. Choose Tools|Configure Palette, or right-click the component palette and choose Properties to open the Palette Properties dialog box.
  2. Select the Pages tab.
  3. Select the appropriate page in the Page column and the component in the Components column.
  4. Double-click the component, or click the Properties button to display the Item Properties dialog box.

    Palette item properties

    Note: An image of the selected component is displayed in the Item Properties dialog box to the left of the Icon options.

  5. Do one of the following:

  6. Click OK to close the Item Properties dialog box.
  7. Click OK in the Palette Properties dialog box when you're finished.

Removing a page or component from the component palette

To remove a page or component from the palette,
  1. Choose Tools|Configure Palette, or right-click the component palette and choose Properties.
  2. Select the Pages tab in the Palette Properties dialog box.
  3. Select the appropriate page in the Page column and the component in the Components column.
  4. Click Remove, then click OK.

Reorganizing the component palette

To change the order of the pages or components on the palette,
  1. Choose Tools|Configure Palette, or right-click the component palette and choose Properties.
  2. Select the Pages tab.
  3. Select a page in the Page column or a component in the Components column.
  4. Click either Move Up or Move Down to move the selected item to a new location.
  5. Click OK when you are finished.