Okay people, I found a way to do this .. ALong with setting the column min, max and widths to 0, you also need to setPreferredWidth to 0 also.
Originally posted by Sandhya:
Hi How do I hide only some columns in a JTable.I tried the following code
TableColumn column1 = null;
column1 = JTable1.getColumnModel().getColumn(2); column1.setMaxWidth(0);
column1.setMinWidth(0);
column1.setWidth(0);
column1.setResizable(false);
But, it is having ... in the table header and the table looks real ugly now.
Thanks
Sandhya