> Hi,
>
[quoted text clipped - 15 lines]
> Or is this all down to my own design. I guess I'm asking for "What,
> if any, is the usual event mechanism between GUI/non-GUI objects?"
I think that yes, this comes down to your own design.
You can even create your own Event/Listener scheme, with or without
inheriting from any particular API Event.
> Anyone got any good resources online?

Signature
monique
Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
JFalt - 01 Feb 2006 14:20 GMT
I find that using custom events leads to much cleaner code that is much
more easily expandable. In cases where you have a particularly complex
GUI with many components within components, custom events are a simple
way to adhere to encapsulation and avoid repeating functionality in
various classes. By using custom events, new modules can be plugged in
and operate autonomously, and yet still have the ability to interact
with the other classes where necessary in a standard way, meaning you
won't have to hack up your code everytime you want to expand the
functionality.
> Hi,
>
[quoted text clipped - 17 lines]
>
> Anyone got any good resources online?
It really comes down to what information you are trying to communicate
between the classes. For instance if you have a button on your GUI and
you want to tell your non-GUI class that it has been pressed the
standard ActionListener is the way I would go. When I am writing code I
tend to take the view "why re-invent the wheel" - or in other words if
there is already a standard listener that does what you want then use it
and if there isn't then you will have to write your own. You can of
course also adapt existing listeners to do what you want - e.g.
PropertyChangeListeners normally get fired when the bounds of a
component have changed but there is nothing to stop you firing your own
PropertyChangeEvent when the contents of a text field has changed.