Click to See Complete Forum and Search --> : JTable - Setting Focus back after accessing a popup window


Nikhil Kumar
February 5th, 2003, 10:21 AM
I have a scenario where a user edits a cell, invokes a popup window and wants to return to that specific cell. Any suggestions as to how this can be done.

Nikhil

Magus
February 5th, 2003, 08:07 PM
I haven't tested it or anything. I just took a brief look at the JTable documentation and thought of the following:


JTable table = new JTable(); //just to be thorough... LOL
int columnIndex = table.getSelectedColumn();
int rowIndex = table.getSelectedRow();
// .
// .
// .
// whatever
table.changeSelection(rowIndex, columnIndex, false, false);



Lemme know if it works for you... It should at least give you an idea.