How to listen for bean's property change event?
In this example we'll listen to bean's property change event. We create a small bean named
MyBean, adds attributes and getter/setter. We want to know or to get notified when the bean property name is changed.
First we need the add a
PropertyChangeSupport field to the bean, with this object we will fire the property change event. When we need to listen for the change we have to create an implementation of a
PropertyChangeListener. In this example we'll just use the
MyBean class as the listener.
PropertyChangeListener has a method called
propertyChange and inside this method we'll implementing the code to get the event fired by the