This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
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, 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: 5148
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Remove the column from the TableColumnModel.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic