Customizing JavaBeans components
When writing in Java, it may be useful for you to take existing beans and alter them to better suit your purpose. The Customize Bean command enables you to create an instance of a JavaBean, customize its properties, and save it as a serialized prototype. This may be done on a Java class or on an already serialized prototype (
.ser
file). The class must be public and have a public default constructor, and it must also be serializable to make a serialized prototype from the customized settings.To customize a JavaBeans component:
- Right-click on the bean in the Explorer and choose Customize Bean from the contextual menu.
The property sheet for the JavaBeans component will open up. If the bean is a visual component (meaning that it extends
java.awt.Component
), the component itself will also appear on the screen.![]()
- Make the desired changes in the property sheet (or, if it is a visual component, on the component itself).
- Click Serialize or Serialize as to create a serialized prototype (
.ser
file) of the bean with its customized properties.Serialize As enables you to select a name and location for the
.ser
file. Serialize (available for.ser
files only) saves the bean into the same.ser
file it originated from, overwriting the previous content.If you do not want to keep the customized settings, press the Cancel button to close the customization window.
Contents | Prev | Next | Index |