aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes jtable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "jtable" Watch "jtable" New topic
Author

jtable

Beny Na
Ranch Hand

Joined: May 26, 2004
Posts: 159
hi all,

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

thanks
Andy Zhu
Ranch Hand

Joined: May 26, 2004
Posts: 145
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 ]

--------<br />Andy Zhu<br />scjp 1.4<br />scjd 1.4<br />SAS Certified Programmer 9.0
peter wooster
Ranch Hand

Joined: Jun 13, 2004
Posts: 1033
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

Joined: May 26, 2004
Posts: 159
Thanks Peter, Andy...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jtable