English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

I am looking to display a recordset in a table that updates itself every x minutes. The problem I am having is I want to keep the selected row selected.

2006-07-01 00:32:17 · 1 answers · asked by Kev 2 in Computers & Internet Programming & Design

1 answers

Try getting the location of the currently selected row before the update (using getSelectedRow()). After the update reselect that row using the setRowSelectionInterval(int,int) method setting the tow parameters as the row number.

Example (assuming that the table is T):

int i = T.getSelectedRow();
/**Update table**/
T.setRowSelectionInterval(i,i);

2006-07-01 09:25:47 · answer #1 · answered by isita 5 · 4 1

fedest.com, questions and answers