It's not a secret anymore!
The moose likes Swing / AWT / SWT and the fly likes JTable is not getting refreshed. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTable is not getting refreshed." Watch "JTable is not getting refreshed." New topic

JTable is not getting refreshed.

Raj Sikka
Ranch Hand

Joined: Apr 11, 2003
Posts: 34
I have a class which implements TableModel.
Inside the class i am using a JTable which has dynamic data.
So i need to refresh the JTable whenever data changes.
For that i am using following lines:
But i couldnt refresh the JTable .It is showing old data.
I read somewhere that i need to refresh the "model" not the "jtable".
If it is true , how to refresh TableModel?
Pls suggest some solution.
Appriciate any Code samples.
Joe Ess

Joined: Oct 29, 2001
Posts: 9189

If you did not create your own data model, you can invoke the appropriate fireTable*() method on the data model. This will send an event to the data model's listeners (the JTable being one of them) that the data has changed. Look at the documentation for the an explanation of the various fireTable*() methods.

[How To Ask Questions On JavaRanch]
I agree. Here's the link:
subject: JTable is not getting refreshed.
It's not a secret anymore!