• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HELP on JTABLE and table model

 
Ranch Hand
Posts: 38
Oracle Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i need help on clearing tables guys
i want to clear the tables then get all the elements from JDBC again just like what it does on form load the problem is when i clear it which i did. but whenever i call the upTable it loads 6 columns instead of just three

this method is triggered by a button
also please comment on the way i put rows is it proper to use a constructor object or a different way is way much better?
 
Sheriff
Posts: 22783
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Removing a column from your JTable does not remove the column from your TableModel, only from the visual representation.
Assuming you're using a DefaultTableModel, you can clear that with just two lines:

joseph dela cruz wrote:also please comment on the way i put rows is it proper to use a constructor object or a different way is way much better?


Since you create the object, get its values, then discard it, I would skip it completely:
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic