This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Swing / AWT / SWT and the fly likes Jtable Focus Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Jtable Focus Problem" Watch "Jtable Focus Problem" New topic
Author

Jtable Focus Problem

vinaya kumar
Ranch Hand

Joined: Jan 20, 2002
Posts: 70
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

Joined: May 11, 2001
Posts: 152
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

Joined: Jan 20, 2002
Posts: 70
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

Joined: May 11, 2001
Posts: 152
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
 
Consider Paul's rocket mass heater.
 
subject: Jtable Focus Problem