Basic HTML version of Foils prepared March 23 98

Foil 21 Using Bound Properties

From JavaBeans and Use in ComponentWare Basic Information Track Computational Science Course CPS616 -- March 25 1998. by Nancy McCracken, Geoffrey C. Fox, Wojtek Furmanski


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 event methods getOldValue() and getNewValue.



© 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 Sun Nov 29 1998