This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Java in General and the fly likes Panel loses focus when Tab is pressed? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Panel loses focus when Tab is pressed?" Watch "Panel loses focus when Tab is pressed?" New topic
Author

Panel loses focus when Tab is pressed?

Jeff Grant
Ranch Hand

Joined: Dec 19, 2001
Posts: 169
I have a panel which I am listening to with a KeyListener. I have just upgraded my system to Windows XP. That bug with the event.VK_TAB still persists... not that I thought upgrading my OS would fix it. Anyways, now when I press Tab, the panel I am listening to loses focus and I do not know which panel gains focus. Since I cannot tell what has focus and the VK_TAB key does not cause an action on my KeyListener, does anyone have a suggestion on how I can either disable the VK_TAB or have my Panel gain focus again? I even went as far as to create a thread in the file which calls this Panel into view which constantly has that window get focus every 10ms. Still doesn't work. Any help would be apprecaited. Thanks!
David G Risner
Ranch Hand

Joined: May 02, 2002
Posts: 30
How about using a FocusListener on your Panels?


David G. Risner<br />Software Engineer<br />California State University, Los Angeles
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Panel loses focus when Tab is pressed?
 
Similar Threads
VK_TAB event not working
Problem with KeyEvent and VK_TAB
HOW to write code for VK_TAB
JTabbedPane - traversing focus through tabs
doubt in focus