Communicating Events Created by JavaBeans

Beans need to talk to other beans. Users talk to a bean through events created by interacting with the bean's graphical user interface. Likewise, a bean talks to other beans through events created when one of its properties changes. In this section, you will write a bean that creates a JavaBeans property change event, and you will write another bean that can receive and process the property change event.

Writing Java Beans That Create Property Change Events

In this section you write a Java bean named SendEvents that, like the beans you wrote in the previous sections, presents three buttons all sitting in a panel. The buttons are labeled Green, Yellow, and Red. When the user clicks a button, the background ...

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.