Originally posted by Karnati Sudhakar:
Just added this line:
And everything is working fine.
Yes, that would work, but code ugliness remains.
If you really want to instantiate a new table and scroll pane every
is called, then there should be no point in
presumably the new ones should completely replace the old ones in
It's better, I think, to keep the same table and scroll pane throughout.
Just update the data array and call fireTableDataChanged
, like this: