File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTabbedPane default component focus in tab panels

 
Abhishek Reddy
Ranch Hand
Posts: 259
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
Maneesh Godbole
Saloon Keeper
Posts: 10971
11
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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().
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic