This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Adding columns dynamically to JTable problem  RSS feed

 
Daniel Roach
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a application based on a Jtable. A custom model class has been created by extending AbstractTableModel. Columns are created individually, from an input file, and then added to table. The Table is displayed in an JInternalFrame. I want to be able to add columns. I have added a menu, which adds the new data to the data model, but as AutoCreateColumnsFromModel is false, FireTableStructureChanged does not add in the new column. I have added a new TableColumn object to the table, but can't get the table to change. I have tried calling doLayut and repaint on the table but with no success. Does anyone have any suggestions?
Thanks in advance.
Daniel
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!