Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tab Order

 
Andy Holm
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a JTextField followed by a JTable followed by another JTextField and JTable. How do I set the tab order to go from one JTextField to the next without going to the JTables in between?
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
set your own FocusTraversalPolicy
 
Andy Holm
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there anyway to make this work on only a JPanel? I can get it to work on a JFrame but not just on a JPanel. I have many JPanels and don't want to have to create policies for all of them when only one needs the policy.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
> Is there anyway to make this work on only a JPanel?

set the panel's policy, then add this line
panel.setFocusCycleRoot(true);

but the panel will be bypassed in the frame's traversalPolicy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic