hi, i spend many sleeples nights trying to solve it i did it this way:
first create custom table model like this, and ascribe it to the table:
DefaultTableModel tableModel = new DefaultTableModel(null,new String[]{"Column1", "Column2", "Column3"}); then to remove column from view you do
table.removeColumn(table.getColumnModel().getColumn(columnId)); where columnId is column number from table model
to bring it back
table.addColumn(new TableColumn(columnId)); you have to remember about:repaint() each time you add, remove column
always remove columns from the last one, because if you have columns 0,1,2,3 and remove column(0) the indexes are recount and you will have columns 0,1,2
use
table.convertColumnIndexToModel(table.getSelectedRow());
first if you want to read data
add, change, remove rows should be done on tableModel, not on the table directly
i guess there is many ways to do this, but i found only this one to work
its get a little bit more tricky if you want to sort the table too...