Re: Event passing in (Swing) GUI Application



On 2006-01-31, Wardie penned:
> Hi,
>
> I'm build a GUI app using Swing. I want to have it be as modular as
> possible for all the usual reasons including reuse of common
> components.
>
> Some of my componets are GUI panels, some are non-GUI classes.
>
> I'm a little confused as to the best way to communicate between
> components though. When I use a Swing Jxxx widget I can register
> EventListeners and FocusListeners etc. What sort of event mechanism
> should I be using to talk between my higher level application
> components?
>
> I've gone with use PropertyChangeEvents for now should I be used
> custom events though?
>
> 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?
>

--
monique

Ask smart questions, get good answers:
http://www.catb.org/~esr/faqs/smart-questions.html
.



Relevant Pages

  • Re: OT swingsets
    ... commercial versions for design cues. ... climbing those chains and slipping onto a slightly open hook. ... Speaking of swing injuries. ... It needs to be sand or some other soft surface ...
    (rec.crafts.metalworking)
  • Re: Learning Java ...again
    ... first program in Chapter 2 is a Swing program. ... on the programmer understanding OO design, ... to teach Java and OO together. ... Trying to ignore that is likely to lead to some weird design patterns. ...
    (comp.lang.java.programmer)
  • Swing application design
    ... actionlisteners to create a nice GUI with Swing. ... GUI application in general is. ... any code is right now done in the invoked events of main ... application showing the design idea behind it. ...
    (comp.lang.java.gui)
  • Re: Swing application design
    ... > actionlisteners to create a nice GUI with Swing. ... > application showing the design idea behind it. ... there's a sub section on SwingWorker, and how to invoke it from within an ...
    (comp.lang.java.gui)
  • Re: Universal advice
    ... designed to exaggerate a movement to eliminate a fault. ... no teaching professionals where I lived as a kid) I learned to swing by ... You could not design a worse thing for me ... Keeping your head perfectly still on chips and putts until the ball ...
    (rec.sport.golf)