tags:

views:

23

answers:

1

I have a bunch of JTextComponents that fire update events to a common model. The model then fires out change events to the other components so they can all be in synch. How can I detect which one fired the event initially so as not to fire the event back? I ask this as I'm currently getting an expection due to attemtping to update the component that fired the event.

+4  A: 

There should be a getSource method on the event object. Use that to obtain a reference to the component that originally fired the event. You can then skip that component when distributing the event.

Shakedown