repainting table, but keeping row selection

Hey all,

I am repainting my table after updating a field, but would like the selected row to continue to be selected. As far as i can tell, i can't find a function that is like setSelectedRow(). Is there a way to keep the selected row once the window is repainted?

Thanks,

Jason

[304 byte] By [jmgreen7a] at [2007-10-2 4:43:06]
# 1
Never mind. I had this line in that kept the selection from remaining:((AbstractTableModel)table.getModel()).fireTableDataChanged();the table.repaint() allows the selection to remain.
jmgreen7a at 2007-7-16 0:48:15 > top of Java-index,Desktop,Core GUI APIs...
# 2

> the table.repaint() allows the selection to remain.

You are still doing something wrong.

You should be using table.setValueAt(...) to update the contents of a cell. Then the TableModel will use fireCellContentsChanged(..) which will cause the cell to be repainted. If this is not happening then something is wrong with your TableModel.

camickra at 2007-7-16 0:48:15 > top of Java-index,Desktop,Core GUI APIs...