GeeCON Prague 2014*
The moose likes Swing / AWT / SWT and the fly likes Problem with JTabbed pane focus Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Problem with JTabbed pane focus" Watch "Problem with JTabbed pane focus" New topic
Author

Problem with JTabbed pane focus

Archana Venu Aradhyula
Greenhorn

Joined: Nov 05, 2008
Posts: 13
Hi,

I have JTabbed pane set to the frame.This consists of two tabs. First tab say for ex: Tab 1 consists of some components. To one of the components in the Tab 1 i have set a short cut key Ctrl Up arrow.

When i start the application this short cut key works fine. But if i navigate from one tab to another tab, the focus remains on Tab 1 and the short cut key fails.

What should i do to solve this problem.

Thanks
Archana
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10425
    
    8

When the tabs are switched make a call to request the focus on your desired component.


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
Archana Venu Aradhyula
Greenhorn

Joined: Nov 05, 2008
Posts: 13
Hi

That is fine. If i explicitly click on the Tab 1 and select the short cut key (Ctrl UP Arrow) the focus is remained there only. Short cut key is not working.

Thanks
Archana
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10425
    
    8

What exactly do you mean a "short cut key"? What do you mean "select the short cut key"?
Please use simple English. I am absolutely unable to understand "focus is remained there only" Where is there? The tab? the component?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem with JTabbed pane focus