Project frame focus & blur
Hi, I'm trying to determine whether the current project frame has focus or not. It's not too hard to do this by getting the JFrame (WindowManager.getInstance().getFrame(project)) and attaching a window focus listener however there is a limitation with this method.
Any time you bring up an idea dialog it you get a windowLostFocus event. I'm only interested in knowing when the focus goes away from the project window and onto either another project window or to another application entirely. Is there a workaround or a better alternative listener I can use?
Regards
Glen Stampoultzis
请先登录再写评论。
In the focusListener.focusLost() method you can retrieve the opposite window
which will get the focus. If it is null, it is a different application.
Maybe this helps you.
Tom
On 07/10/2009 06:26, Glen Stampoultzis wrote:
>
>
>
>
It's possible that the focus lost event you get for the dialog situation
has isTemporary() as true... haven't checked this however.
N.