Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Jtable Focus Problem

 
vinaya kumar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
I have two table A and B.
A has 3 Columns X,Y,Z
B has 2 Columns P,Q
After entering a Data in the Column X ,my focus should shift to column P in table B.
And later after filling in Table B , my focus should shift to column Y.
How do i achieve this.
I could not find any API in JTable which will
select a Cell at (row,col) position.
Thanks and Regards
vinaya
 
Joe Gilvary
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you look at editCellAt() in JTable?
public boolean editCellAt(int row, int column, EventObject e)
It might be just the thing you need.
HTH,
Joe
 
vinaya kumar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a Lot...
One more doubt
I saw this editCellAt(row,col,EventObject e)
but what should be the EventObject be
vinaya
 
Joe Gilvary
Ranch Hand
Posts: 152
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think it can be null. Check the Javadocs.
It used to be passed on to the CellEditor, but
is not passed in later versions of Swing.
HTH,
Joe
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic