Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Another DefaultTableModel post

 
Przemek Wisniewski
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Everybody,

I've got the MySQL "Database" with one table and just a few records in it. I am able to display all the records just fine using "select * from..". However, once displayed when i try to filter/search for something the from the table, I want only the relevant rows to be left/displayed in a table. I am also using the DefaultTableModel's insertRow() method. But it just appends the record in the first row. And it seems like there's no "clear()" method, so I tried to creat new(another) DefaultTableModel inside my search method in order to clear the previous (select * from..) but still no luck.. I have no idea why it won't work. I thought that when i setModel() again it should refresh display? What am I doing wrong?
 
Przemek Wisniewski
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Calling setRowCount(0) has solved the issue.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic