Previous | Next | Trail Map | JavaBeans Tutorial | Table of Contents


Writing a Simple JavaBean

Beans are designed above all to be simple. You need only add a minimal amount of code to an existing class defintion to turn a class into a JavaBean.

In the simplest case, you need only add a pair of methods to an existing class definition in order to make a Bean. This can be done either by modifying the source for an existing class, or by extending the behavior of an existing class by subclassing it.

On first impression, there appears to be no difference between a JavaBean and a traditional Java AWT component object. This appearance is intentional. While there are minor differences, such as the fact that Beans need not be visible components, Java you need only follow a few simple rules to make Beans out of existing classes.

Now What?

Now you can:


Previous | Next | Trail Map | JavaBeans Tutorial | Table of Contents