Hiding columns in a JTable
I have a hard time hiding columns in a JTable. Every time I try to hide the columns I wanted, just the columns headers gets hidden but the actual column associted with those headers remain visible. However, the columns towards the end disappers yielding the right column count. For example if I want to hide col3, and col 4 of a table consisting of 7 columns, the column headers of col3 and col4 disappears but not the actual column(data) itself. To my great surprise, the data for last two columns disappears( not the column headers). I use my own DefaultTableCellRenderer (MyPopulateTableCellRenderer class)to populate my table.
When I remove columns I do this:
myJTable.setDefaultRenderer(MyRecordInfo.class, new MyPopulateTableCellRenderer() );
myJTable.removeColumn(myJTable.getColumn("Col 3"));
myJTable.removeColumn(myJTable.getColumn("Col 4"));
Can anyone please tell me what am I doing wrong?

