aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JTabbedPane default component focus in tab panels Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTabbedPane default component focus in tab panels" Watch "JTabbedPane default component focus in tab panels" New topic
Author

JTabbedPane default component focus in tab panels

Abhishek Reddy
Ranch Hand

Joined: Mar 28, 2006
Posts: 259
I have a tabbed pane with two tabs and respective JPanels...

In each of the JPanel i have some components say JTexField, JTextArea e.t.c..

Now the problem is when i shift from one tab to another tab, one of the component should have the focus..

I have tried with grabFocus() method but it did not solve my problem..
Is there any other way of solving the problem


Abhishek
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 9990
    
    7

From the API for grabFocus()
his method is intended for use by focus implementations. Client code should not use this method; instead, it should use requestFocusInWindow().


[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTabbedPane default component focus in tab panels
 
Similar Threads
JTextField.requestFocus is not working in jre 1.6
JTable Cell and Tab Problem[jdk1.3 ]
KeyListener failing for Macs
Tab order on swing components
Problem with JTabbed pane focus