Hi,
i need a Function for columns like DefaultTableModel.insertRow(). I think there is no. Does someone
knows a workaround?
By, Lars.
Printable View
Hi,
i need a Function for columns like DefaultTableModel.insertRow(). I think there is no. Does someone
knows a workaround?
By, Lars.
There is nothing like that in TableModel.
But u can use the JTable's methods addColumn(TableColumn) and moveColumn(int,int);
addColumn(TableColumn) will add a column at the end table. After that use moveColumn(int index, int target) to move your column where u want to be.
I hope this will solve yours.
regards,
arun...
Well there may be another way, if u have sub-classed 'AbstractTableModel'.
U can make the sub-class work for dynamic columns. Here u just need to design the class such that,
1. getColumnCount method returns the number of columns u want
2. then other methods will reflect the change according to the number of columns.
After u change the number of columns u just need to repaint the JTable.
- UnicMan
http://members.tripod.com/unicman