This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question about refresh/reload on JTable

 
Stef Widmer
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic