Thread: listening...
View Single Post
Old 10-13-2002, 10:20 AM   #5 (permalink)
technobard
Centurion Nova Prime
 
technobard's Avatar
 
Join Date: May 2002
Location: Oak Park, IL (USA)
Posts: 287
technobard is on a distinguished road
Okay. So you create a manager object (changeSupport) and you register objects that have members that want to be monitored with the manager. Then you add/create listeners (PropertyChangeListener) to listen for events around the registered object member.

As part of the listener creation, you specify an action that occurs when a property changes by specifying the propertyChange(PropertyChangeEvent pce) method. Presumably you could modify this to include a method call on the listening object that would update totals, for example, that included the changed object.

I could see this being useful. I also understand why it is normally tied to a GUI since it would make sense to refresh a display after updating values.

Thanks for sharing the code.
technobard is offline   Reply With Quote