Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTable Cell and Tab Problem[jdk1.3 ]

 
vinaya kumar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I want to transfer focus to next component from a table with one column, i add one value to row
then i press tab.
I expected the focus to shift to next component,
but nothing happened, the cell got selected and then when i pressed tab again, row got selected
and then now for the third time i pressed tab
the focus shifts to the next component.
is this problem with jdk1.3.1_01 , how to fix this.
 
Michael Morris
Ranch Hand
Posts: 3451
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is happening is the default behavior for a JTable. I think this will solve your problem but I'm not totally sure.
There is a method with the following signature which is inherited from JComponent:
public boolean isFocusTraversable()
This usually returns false but is overridden in JTable to return true.
I would try subclassing JTable and overriding the above method and have it return false and see if that works.
Good lucl
 
vinaya kumar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Michael,
Problems sounds to be have fixed.
Now i finding one more problem,
my next component is a panel in which is one more table, so now my focus should be on Row 0,column 0.
Should there be a focus listener on the table,which on getting focus says editCell(0,0)
vinaya
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic