Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Pressing Tab enter JTable, pressing Tab again exit JTable

 
Ling Chung
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello all,
i have a few fields in a panel and by pressing tab i go through them as i want it to, but beneath this panel is JTable when i enter this table upon pressing Tab it goes further by setting focus to each column and expanding to the next row if you keep pressing Tab. I would like to set focus only once to the first row of the Table and then next Tab will be exit JTable and set focus again to the fields in my panel.
How can this be accomplished?
Thanks a lot!!!
 
Fuqiang Zhao
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
table.setFocusTraversalKeys(KeyboardFocusManager.FORWARD_TRAVERSAL_KEYS, null);
table.setFocusTraversalKeys(KeyboardFocusManager.BACKWARD_TRAVERSAL_KEYS,
null);
table.setFocusCycleRoot(false);
 
Ling Chung
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot this is exactly what i needed.
But now it selects the first cell in the table but how can i make it to select the entire row when focus is on the table when TAB is pressed?
Thanks for the help!!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic