8.8.1. Writing a Customizer Class

Any customizer class you write must have a no-argument constructor, extend the Component class, and implement the Customizer interface. That interface has only three methods:

• The setObject method taking a parameter that specifies the bean being customized

• The addPropertyChangeListener and removePropertyChangeListener methods which manage the collection of listeners notified when a property is changed in the customizer

It is a good idea to update the visual appearance of the target bean by broadcasting a PropertyChangeEvent whenever the user changes any of the property values, not just when the user is at the end of the customization process.

Unlike property editors, customizers are not automatically displayed. ...

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.