|
-
August 11th, 1999, 10:43 AM
#1
insertColumn in a JTable?
Hi,
i need a Function for columns like DefaultTableModel.insertRow(). I think there is no. Does someone
knows a workaround?
By, Lars.
-
August 12th, 1999, 07:45 AM
#2
Re: insertColumn in a JTable?
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...
-
August 12th, 1999, 08:11 AM
#3
Re: insertColumn in a JTable?
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
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
|