What\'s the main difference between the method windowActivated (implemented from WindowListener) and windowGainedFocus (implemented from WindowFocusListener)?
The Java d
From How to Write Window Listeners which reflects the quote in your question aswell:
windowActivated(WindowEvent)andwindowDeactivated(WindowEvent):Called just after the listened-to window is activated or deactivated, respectively. These methods are not sent to windows that are not frames or dialogs. For this reason, the windowGainedFocus and windowLostFocus methods to determine when a window gains or loses the focus are preferred.
So windowActivated is only executed when the window is a frame or dialog, while the windowGainedFocus is for all types.