Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jtable

 
Beny Na
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

any one know how to clear the results in jtable, which
method i have to use?

thanks
 
Andy Zhu
Ranch Hand
Posts: 145
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think when you reset the data structure in your tablemodel to null/empty, your jtable will be clear.
[ December 19, 2004: Message edited by: Andy Zhu ]
 
peter wooster
Ranch Hand
Posts: 1033
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Andy Zhu:
I think when you reset the data structure in your tablemodel to null/empty, your jtable will be clear.

[ December 19, 2004: Message edited by: Andy Zhu ]


You need to clear the collection that contains the row data and then use fireTableDataChanged to tell the table to redisplay everything. This all happens in your table model, the object that extends AbstractTableModel.
 
Beny Na
Ranch Hand
Posts: 159
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Peter, Andy...
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!