Providing a Bean Customizer

Provide beans with graphical user interfaces for easy configuration by creating an associated object implementing the java.beans.Customizer interface. A bean customizer goes beyond property editors by providing an easy-to-use graphic interface for changing a wide range of bean options. Create your own customizer interfaces, or use some of the standard interfaces provided by the Java platform. In this section, you write a simple bean that supplies a customizer interface for choosing its background colors using the standard javax.swing.JColorChooser class.

Creating a Bean

You can associate a customizer with any Java bean. For this example, create a bean that displays the word "Hello" on a small piece of canvas. The source ...

Get JavaBeans Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.