# Adding Images

You can insert graphic images into your layout with the following components:

- Image Button. Inserts an icon that, when clicked, displays the image in a browser.
- Image Label. Inserts a text label that, when clicked, displays the image in a browser. The path to the image is specified in the attribute editor.

To add an image to the layout:

1. Click on either the Image Button or Image Label component in the Additional palette tab.
2. Click in the cell where you want to place the component.
3. Open the attribute editor by clicking on its button in the toolbar.
4. Type a unique component ID in the name box.
5. Type the names of the menu options in the items box. Each name should be separated by a comma.
6. Type the relative path to the image in the image box.

## Special Attributes

`image` | The path name of the file that contains the image. The path to the image can be an URL or (preferably) a path name relative to the codebase of the applet. So, if the applet's `.class` file and image files are in the same directory, only the simple file name is required.
`pressMovement` | The number of pixels down and to the left that the image moves when the button is clicked. (Not an attribute of Image Label.)
`lineWidth` | The width (in pixels) of the button bevel. (Not an attribute of Image Label.)
`padWidth` | The number of pixels between the edge of the button and the image displayed within it.

See also:

  Laying Out the Interface
  Generating Java Source Code
  Adding Operations to Components
  GUI Builder Palette

  Visual Java GUI Builder API Documentation
    Visual Java GUI Builder Runtime Packages
    Class Hierarchy
    Index of All Fields and Methods