
Signature
Roedy Green, Canadian Mind Products
The Java Glossary, http://mindprod.com
On Sat, 12 Jan 2008 14:23:47 GMT, Roedy Green
<see_website@mindprod.com.invalid> wrote, quoted or indirectly quoted
someone who said :
>I have a table cell renderer that display a row differently depending
>on whether it is selected. However, JTable does not seem to be smart
>enough to repaint a row when it stops being selected or when it
>becomes selected because of other rows being added or removed.
The solution is this:
/**
* abort any edit in progress
*/
private void stopEdit()
{
// stop any edit in process
TableCellEditor tce = jTable.getCellEditor();
if ( tce != null )
{
tce.stopCellEditing();
}
}
This must be called prior to anything that would sort, add, delete or
replace rows.

Signature
Roedy Green, Canadian Mind Products
The Java Glossary, http://mindprod.com