Possible Duplicate:
How to make a columns in JTable Invisible for Swing Java
How to hide a particlar column in DefaultTableModel from displaying it in table?
I am trying to enter data to three columns in JTable, but I want to show only two columns. Actually, I want to hide the third column, not by setting the width to 0, but by any other method in which I can get the data from the hidden column on a click event.
How can I hide a column in this manner?
I am using the following code:
 try {
     String Title[]= new String{"a","b","c"};
     Object obj= new Object[50][3];
     JTable table= new JTable(obj,title);
     JScrollPane jsp= new JScrollPane(table); 
     add(jsp);
 } catch(Exception ex) {
     ex.printStackTrace();
 }
 
     
    