8.2. The Bean-Writing Process

Writing a bean is not technically difficult—there are only a few new classes and interfaces for you to master. In particular, the simplest kind of a bean is nothing more than a Java class that follows some fairly strict naming conventions for its methods.

Image Note

Some authors claim that a bean must have a no-argument constructor. The JavaBeans specification is actually silent on this issue. However, some builder tools do require a no-argument constructor for each bean.

Listing 8.1 at the end of this section shows the code for an ImageViewer bean that could give a Java builder environment the same functionality as ...

Get Core Java® Volume II—Advanced Features, Ninth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.