-
September 29th, 2011, 01:42 PM
#1
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
-
September 29th, 2011, 03:28 PM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|