aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Question about refresh/reload on JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Question about refresh/reload on JTable" Watch "Question about refresh/reload on JTable" New topic
Author

Question about refresh/reload on JTable

Stef Widmer
Greenhorn

Joined: Jun 16, 2004
Posts: 17
Hi all,
I'm using ItemTable (a JTable) to present the records and a ItemTableModel (which extends AbstractTableModel) to retrieve the data from the database. When I start my Client and create the ItemTableModel, I fill the "data" array with a call like this: data = connector.getAllRecords();.
So far everything is fine, I got all records to display in my ItemTable. But then I'm stuck with one thing . What do I have to do to perform a "refresh" or a "reload" of all data on the ItemTableModel? I tried to fill the data array again with all records and fire "fireTableDataChanged()" but without success.
Can somebody give me a hint?
Tia...
Stef
[ June 28, 2004: Message edited by: Stef Widmer ]
Chirag Doshi
Greenhorn

Joined: Jul 09, 2003
Posts: 21
hi Stef,

I tried to fill the data array again with all records and fire "fireTableDataChanged()" but without success.


Did you try

where table is your JTable object?

I have used it this way and it works for me.

regards,
Chirag
Stef Widmer
Greenhorn

Joined: Jun 16, 2004
Posts: 17
Thanks Chirag,
I got it to work now.
Stupid, I read all records but forgott to update the data array in the model... Ups!

Cheers
Stef
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Question about refresh/reload on JTable