Creating JavaBeans
A JavaBean is a collection of one or more Java classes that serves as a self-contained, reusable component. A JavaBean can be a discrete component used in building a user interface or a non-UI component such as a data module or computation engine. At its simplest, a JavaBean is a public Java class that has a constructor with no parameters. JavaBeans usually have properties, methods, and events that follow certain naming conventions.
JavaBeans have some unique advantages over other components, such as:
- They are pure Java, cross-platform components.
- You can install them on the JBuilder component palette and use them in the construction and design of your program, or they can be used in other application builder tools for Java.
- They can be deployed in JAR files.
JBuilder's BeansExpress, available in Professional and Enterprise, is the fastest way to create JavaBeans. It consists of a set of wizards, visual designers, and code samples that help you build JavaBeans rapidly and easily. Once you have a JavaBean, you can use BeansExpress to make changes to it. Or you can take an existing Java class and turn it into a JavaBean.
This is a feature of JBuilder Professional and Enterprise.
To access JBuilder's JavaBean wizard to start creating a JavaBean,
- Choose File|New Project and create a new project with the Project wizard.
- Choose File|New to display the object gallery.
- Double-click the JavaBean icon on the New page of the object gallery to open the JavaBean wizard.
For more information, see "Creating JavaBeans with BeansExpress" in Building Applications with JBuilder.