Originally posted by Oliver Stagg:
Does anyone know if you can lock the scroll bar of a JScrollPane when the model of a JTable receives an update? I still want the table to display the new data, but I don't necessarily want the scroll bar moved to make it visible.
I'm not sure what exactly you mean by
receives an update, but JTable does not generally scroll to make updates to its model [in the sense of AbstractTableModel.fireTableRowsUpdated()] visible. The only times JTable scrolls automatically are on selection changes or on user mouse drags, and then only when the table's
autoscrolls property is true.
If you have a JTable that is scrolling when its model updates, I would guess someone has explicitly added code to make that happen. (Or I suppose it's possible you are using an unusual LnF that does it.)
[ April 14, 2008: Message edited by: Brian Cole ]