Win a copy of Practical SVG this week in the HTML/CSS/JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jtable, defaulttable model

 
joseph dela cruz
Ranch Hand
Posts: 38
Chrome Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello guys how can i remove column in JTable?

i have already made a button that when triggered it will add column through

DefaultTableModel tbl = new DefaultTableModer():

tbl.addColumn(columnList.get(x))

now what im trying to do is make a column vanish T T and im surprised i did not see a removeColumn method xD is there anyway i can remove columns through runtime?

and if JTable.remove(component) is the answer how? how can i use it xD
 
Darryl Burke
Bartender
Posts: 5155
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remove the column from the TableColumnModel.
 
look! it's a bird! it's a plane! It's .... a teeny tiny ad
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!