Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

retaining window focus  RSS feed

 
Nidhi Singhal
Ranch Hand
Posts: 89
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I want my application window to retain the focus as long as the application is running i.e. i don't want the focus to be shifted to another window.

I have tried trapping the keyPressed event and setting the keycode to some other value...but it did'nt worked out.

Is there any other way out? How should I go about it?

Nidhi
 
Constanze Michaelis
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nidhi,
I'm quite not sure, if this is right, but what about setting your window focusable?

regards
Constanze
 
Pat Hays
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Nidhi,

You may try to set every Components in other window to be un-focusable.

Eg.
 
Nidhi Singhal
Ranch Hand
Posts: 89
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanx....
I will try and see if this works.


Thanks,
Nidhi
 
Nicky Eng
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
dear Pat, Constanze;

does the code setFocusableWindowState useful for a JFrame??? if you see this post, could you guys go to topic that i created ... thanks.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!