Inserting a column into JTable
- From: Uwe Ziegenhagen <newsgroup@xxxxxxxxxxxxxxxx>
- Date: Mon, 26 Jun 2006 13:15:12 +0200
Hello,
I am currently facing unexpected problems when trying to insert a column
into an instance of JTable:
// Getting the selected column
int col = myTab.getSelectedColumn();
// adding a column to the instance of DefaulTableModel
detMod.addColumn("");
// moving the column to the right place (in the view only)
myTab.getColumnModel().moveColumn(myTab.getColumnCount()-1,col);
This code above only modifies the view, not the model.
myTab.convertColumnIndexToModel(col);
just shows me the mapping. I would like to avoid moving the cells by
hand, can anyone give me a hint on maybe how to modify the mapping?
Uwe
.
- Prev by Date: Print Jtable multiline header
- Next by Date: JTree re-build - need to save the expanded / collapsed state of node
- Previous by thread: Print Jtable multiline header
- Next by thread: JTree re-build - need to save the expanded / collapsed state of node
- Index(es):
Relevant Pages
|