Two Laptop Bag
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
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

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:
subject: Panel loses focus when Tab is pressed?
It's not a secret anymore!