• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Another DefaultTableModel post

 
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.
 
I don't get it. A whale wearing overalls? How does that even work? It's like a tiny ad wearing overalls.
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic