Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Force a repaint of a JTable?

513 views
Skip to first unread message

Just Me

unread,
Oct 25, 1998, 2:00:00 AM10/25/98
to
I have a JTable in a scrollpane.

After I load the table view with new data I do an invalidate(),
validate() on the scroll pane to refresh the view. This works but
only if there is a vertical scrollbar. If the window is large enough
to contain all of the table rows vertically then the table doesn't get
refreshed.

What do I need to do to force a refresh of the table/scrollpane?

Sergey Godunov

unread,
Oct 26, 1998, 3:00:00 AM10/26/98
to
Hello!
I had the same problems.
Try the "validate ()" method immediately after you've done any changes
...
        table.validate ();
...
or use the "validateTree ()" method in the container class that contains
your JTable.

Just Me

unread,
Oct 30, 1998, 3:00:00 AM10/30/98
to

I got it. Use the fireTableDataChanged() method of the
AbstractTableModel.

0 new messages