Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP 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...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic