
Signature
Josef Garvi
"Reversing desertification through drought tolerant trees"
http://www.eden-foundation.org/
new income - better environment - more food - less poverty
>:Is there a recommended way of implementing events?
>:
[quoted text clipped - 6 lines]
>:messages could be deleted. In Win32 I used to do this using the PostMessage
>:and PeekMessage commands.
Visit your friendly neighborhood API and look up PropertyChangeEvent in
the java.beans package. And PropertyChangeListener,
PropertyChangeSupport or its descendant SwingPropertyChangeSupport.
This is where you can notify interested parties of changes to bound
properties. So if you want to use an event mechanism, it's a good way
to go. Your "data object" will likely need to carry one of the
"support" objects as a member variable. It will need to include methods
to add and remove property change listeners. And when properties of
interest change, it'll need to be able to have its support object fire
the notification to all registered listeners, which will carry the
PropertyChangeEvent with details.
If you need additional complexity -- that is, queueing to remove dupes,
etc. -- it can be built around this very simple approach.
HTH.
= Steve =

Signature
Steve W. Jackson
Montgomery, Alabama
Josef Garvi - 10 Mar 2004 06:59 GMT
>>:Is there a recommended way of implementing events?
>
> Visit your friendly neighborhood API and look up PropertyChangeEvent in
> the java.beans package. And PropertyChangeListener,
> PropertyChangeSupport or its descendant SwingPropertyChangeSupport.
> ...
Thanks.

Signature
Josef Garvi
"Reversing desertification through drought tolerant trees"
http://www.eden-foundation.org/
new income - better environment - more food - less poverty