• Post Reply Bookmark Topic Watch Topic
  • New Topic

Tab question  RSS feed

 
Dilip kumar
Ranch Hand
Posts: 360
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All:
My java application has frame with JTable, JComboboxes, and JButtons. Right now when I press Tab key control (focus) goes to next cell in the Jtable. Is there any way we can pass the focus to next component instead of passing to next cell when we press Tab key in JTable ?
Thanks
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use setNextFocusableComponent() to set the tab order of a form after I am finished laying it out. Pretty much have to set it for each form element you have. It's a little cumbersome to do it for many elements, but really makes a difference in the way the form feels.
 
gsoysal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could also try extending your JTable and overriding the isFocusTraversable() method to always return false. That method checks whether a particular JComponent should be part of the traversal list of components when you tab...
 
Sayed Ibrahim Hashimi
Ranch Hand
Posts: 148
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was wondering how if the default focus order determined? Is it the order in which components are added?
Thanks in advance.
Originally posted by Scott Knight:
I use setNextFocusableComponent() to set the tab order of a form after I am finished laying it out. Pretty much have to set it for each form element you have. It's a little cumbersome to do it for many elements, but really makes a difference in the way the form feels.

 
mohamed zafer
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello guys,
Do u have nay idea to set the focus to the next component when I press the tab key. I am using awt. What is the equivalent method to setNextFocusableComponent() in awt.
Thanks in advance,
Zafer
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!