Technical Support
Discussion Forum
Online Training
Read About Java
Java In-Depth
Product Discounts
Membership Information

Java Cup Logo

JDC Home Page

Online Training
shadowSearchFAQFeedback

Online Training Index

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.





Questions?
27-Mar-97
Copyright © 1996,1997 Sun Microsystems Inc.
All Rights Reserved.
Sun Logo