# Updating a Bean

Using the GUI builder, you can update a bean in two ways:

- Manually. By choosing GUI -> Update Component Classes in Design, you can select the specific bean classes to update.
- Automatically. By importing a bean to the palette. With automatic updating, all bean classes in the JAR are updated.

To manually update a bean:

1. Choose GUI -> Update Component Classes in Design.
2. Select the bean class or classes you want to update from the list.
3. Click the Update button.

   After you click Update, the project directory is updated with the new bean classes; however, the instance of the bean in the layout is not updated. A pop-up window appears, warning you that you now have an instance of the bean in the layout that is older than the version now recognized in the project:

   - You can update the bean in the layout by clicking Reload Design.
   - You can leave the bean as is by clicking Cancel.

To automatically update a bean:

1. Import a version of an existing bean into the GUI builder palette.

   A dialog box warns you that an update has been detected. It displays the bean classes that will be updated.

2. Click Import and Upgrade.

   All the bean classes shown in the list are automatically updated. The project directory now contains the modified JAR file for the latest instance of the bean and the palette contains that version of the bean. The bean in the layout has not been updated yet.

   After the import and update has taken place, the Reload Design After Update dialog box appears.

3. Click Reload Design to update the bean in the layout. Now your layout contains the newest version of the bean. Build the application to test the latest instance of the bean.

See also:

  Importing Components
  Customizing Beans
  Beans in JavaWorkShop
  JavaBeans - Related APIs