Customization

You change a bean's properties through customization. There are two ways to customize a bean—through property editors and through direct calls to mutator methods.

Property Editors

Earlier in this chapter you learned that a bean's properties are exposed through introspection and are listed in a property sheet along with property editors. You change a bean's property through its property editor. There are many different types of property editors. One of the simplest is the text box where you delete the old value and type in a new one. For example, the default value of OurButton bean's label property is press. You can delete press and type Start Animation into the label text box to change the label property (see Figure 4.4). The result ...

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.