View Full Version : Confusion about Windows Event Listeners

9 May 2008, 9:24 AM

I found that GXT has WindowEvent and WindowListener.
According to javadoc a Window thows 10 WindowEvents if I counted well.
But WindowListener only provides methods for 5 of them. Is this a bug?
A Window also have a method to add window listener and a method inherit from Component addListener.
The question is in which way should I check, for example, for Close WindowEvent? Should I add the Listener with the addWindowListener or with the addListener?
I tried the second one method but it doesn't work and I don't know how to create a listener for the first method because the interface didn't have the windowClose(WindowEvent we) method.

Did I miss something?
Please let me know.


9 May 2008, 10:43 AM
Not all the events are in WindowListener. You can listen for any events using addListener. Window has both a Close and Hide event type. Could the window be hiding? Try adding a listener for Hide. I will add most of the other events to WindowListener.