Java Reference
In-Depth Information
class forward key method calls to it. The Component class in java.awt uses this approach,
although it uses a PropertyChangeSupport object instead of an Observable object.
The PropertyChangeSupport class is quite similar to the Observable class but is part
of the java.beans package. The JavaBeans API exists to support the creation of reusable
components. This API has found its greatest applicability to GUI components, but you can
certainly apply it elsewhere. The Component class uses a PropertyChangeSupport
object to let interested observers register for notification of changes in the properties of labels,
panels, and other GUI components. Figure 9.6 shows the relationship between
the Component class from java.awt and the PropertyChangeSupport class.
Figure 9.6. A Component object maintains a PropertyChangeSupport object that
maintains a collection of listeners.
The Component class duplicates part of the interface of the Prop-ertyChangeSupport
class. These methods in Component each forward the message call to an instance of
the PropertyChangeSupport class.
Search WWH ::

Custom Search