• Post Reply Bookmark Topic Watch Topic
  • New Topic

Setting JTable model after fetching data on another thread

 
Praveen Balaji
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am new to Swing and I have a question.

I need to show data on a JFrame. Here are the steps i need to do:

1. creating a JFrame
2. Setting the frame visible
2. fetching data on a seperate thread
3. setting the data in a Table Model
4. creating the table using this table model
5. firing model event

But the table is not getting refreshed with the newly fetched data.

Any suggestions on how I can get this working will be greatly appreciated.

Regards,
Praveen
[ June 25, 2004: Message edited by: praveen balaji ]
 
Eddie Vanda
Ranch Hand
Posts: 283
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I have not tested this. I got the idea from the main method in Sun's SpringCompactGrid class in their tutorial.

If you are using the DefaultTableModel from which the table was constructed, then the mechanism for updating the table display should be already operational.

Hope that helps.

Ed
[ June 25, 2004: Message edited by: Eddie Vanda ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!