Focus problem when the jframe launches
Hi,
I have a swing based Java application and when the application is launched i request the focus in one of the panel of the frame.
When the application launches, the focus is in the panel and if i click some other windwo outside, say for ex. a notepad i loose the focus from the panel, which is correct.
But the problem occurs when the application is being launched, if i open notepad and keep typing something on the notepad, my application is launched and the panel still has the focus.
I expect the panel to not get the focus or loose it, since i have opened notepad and working on it.
My application does not loose focus till i click on the application window once and then click somewhere.
I want my application's panel to lose focus if i have opened another application like notepad and using it.
I wonder how can i make my application to loose focus.
PS: I tried windowdeactivated from window listener, but this does not seem to work when the application is being launched. Window gets activated and then opened.
And while the application is coming up, if i click notepad and start using it, window does not get deactivated, however if i click on the notepad after my application is fully launched, it gets deactivated.
Is there any way i can get my application to loose focus if someother application is open and user is using that application? Please help..