Click to See Complete Forum and Search --> : action listeners


kram044
03-06-2006, 12:36 PM
Haven't been able to find an answer for this anywhere...
is it possible to implement an actionlistener that listens for an event that takes place in another class?

At the moment I have a class which creates a main window... from that main window the user clicks on a button which creates another window (whilst keeping the main one open). From here i want the main window to do something once a button is clicked on that second window. Have been given a few suggestions regarding abstract classes and threads but i'd rather avoid them if possible.

Thanks guys and gals

Khalid Ali
03-06-2006, 12:55 PM
how if you could have a reference to the parent window in the child and then in the child on an event just use the reference object for parent and do whatever u want to do?

kram044
03-06-2006, 04:51 PM
That's what i thought but couldn't seem to get it working - couldn't get the reference to the parent class sorted. I'll have to have a closer look and see if can get the reference set up properly.

Thanks for quick reply