Setting a Bean's Icon

If you want to add a bean to the component palette or other applications, you might want to specify one or more icons for that bean.

To specify a bean's icon:

  1. Use your favorite image tool to create a GIF image and place it in a mounted filesystem.

    You can create up to four icon images for your bean: 16x16 color, 16x16 monochrome, 32x32 color, and 32x32 monochrome. If you create only one, 16x16 color is the most commonly used format.

    If you want the icon to appear seamlessly in toolbars, make the background of your image transparent.

  2. In the Explorer window, expand the class node of your bean and right-click the Bean Patterns subnode. Choose BeanInfo Editor from the contextual menu.
  3. In the BeanInfo Editor, select the BeanInfo node. Properties are displayed in the right panel for all four icon types.
  4. Click the icon property that describes your icon type. Click the ellipsis (...) button to display the Icon Property Editor.
  5. In the Icon Property Editor, specify the classpath for your icon and click OK.

    If you want to search for your image, click the ellipsis (...) button to the right of the Name field. The Open Image File dialog box is displayed, showing your mounted filesystems. Expand the nodes until you find your image, choose the image, and click OK.

  6. When you have successfully entered the classpath for your image, the image appears in the rectangular region at the bottom of the Icon Property Editor. Click OK.
  7. When you have set the classpath for all icon types you want to set, click OK in the BeanInfo Editor dialog box.

    The BeanInfo class for your bean is generated and code is created to set and get the bean's icon.

See also
Mounting a Filesystem
BeanInfo Editor Dialog Box
Adding a Bean to the Component Palette

Legal Notices