CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2011
    Posts
    15

    remove columns from a tablemodel

    hi everyone, I have a DefaultTableModel that I built with tableModel.addColumn("dasdasfasfs"), thereafter I fill it with addRow.
    I want to reuse the tableModel, but before I want to clear it (rows and columns) to add different columns and different rows.

    for the rows:
    for (int i = 0; i < this.tableModel.getRowCount(); i++) {
    this.tableModel.removeRow(i);
    }

    but don't know how to remove the columns and searched in the forum, but didnt find an answer

    thanks

  2. #2
    Join Date
    Sep 2011
    Posts
    15

    Re: remove columns from a tablemodel

    ok problem solved, use setColumnIdentifiers better than addColumn, it just replace columns

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured