Originally posted by Michael Dunn:
if you don't want the column visible, something like this
table.removeColumn(table.getColumnModel().getColumn(0));
where 0 is the column number.
This removes it from the display area of the table, but not the model.[/QB]
Thanks, I have been trying this but it seems to be removing the column from the underlying model too. If I do:
table.removeColumn(table.getColumnModel().getColumn(6));
The column does not appear in the JTable anymore, however if I then try:
Object o = table.getValueAt(row, 6); // row changes depending the selection
I get an index out of range exception:
java.lang.ArrayIndexOutOfBoundsException: 6 >= 6
I know I've done this before, but something has gone astray ...
Cheers, Jared.