Basic HTML version of Foils prepared May 19 99

Foil 27 Using Bound Properties

From Javabeans Basic Information Track Computational Science Course CPS616 -- Spring Semester 1999. by Geoffrey Fox, Nancy McCracken, Wojtek Furmanski

TextEditor, a bean example with bound properties, property changes, and BeanInfo.
The class with the bound property creates an instance of the PropertyChangeSupport class: PropertyChangeSupport pcs = new PropertyChangeSupport(this); and uses its add and remove listener methods.
Then the class with the bound property must call firePropertyChange whenever it changes the value of the bound property (i.e. in the set method of the property).
Any class which wants to be notified of changes to the bound property must implement the PropertyChangeListener and supply a method propertyChange that will be called with a PropertyChangeEvent. This method can use event methods getOldValue() and getNewValue.
  • The Beanbox will implement this last part for you.



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Mon Jul 5 1999