Creating a Bean Component
Using JavaBeans, you can create and combine reusable software building blocks. A JavaBeans component built once can be integrated without further code changes using any tool that conforms to the JavaBeans architecture.
You can create multiple beans in a beans project.
To add a bean:
- Type the name of the bean in the Bean Name box.
The name of the bean can be one of the following:
- A short file name, for example,
Jelly
- A full path name, for example,
my-install-dir\BeanBag\Jelly
- Decide if you want the bean to have an accompanying BeanInfo file and/or a Customizer file, and select the appropriate checkbox(es).
You can select both the BeanInfo check box and Customizer check box, or just one, depending on your component plan.
- By selecting the BeanInfo file checkbox, Java WorkShop creates a default BeanInfo source file for the bean that you can modify or extend.
- By selecting the Customizer file checkbox, Java WorkShop creates a default Customizer source file that you can modify.
- Click Create New Java Bean.
Java WorkShop automatically adds the .java
suffix to each bean file name, and adds the file to the Java Files list.
- Decide if you want to add another bean to this project.
- If you want to add another bean, repeat steps 1 - 3 above.
- If you do not want to add another bean, click Finish.
Java WorkShop creates source templates for each non-existing file in the New Bean Card list. The source editor shows the source code for the project's first file. And, the project is added to the project manager.