• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to make a column invisble in JTable...

 
vinaya kumar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,
Is there any api's by which i can make certain
columns in the JTable Invisible.

Thanks and Regards
vinaya
 
vinaya kumar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is the solution
TableColumn column1 = null;
column1 = table.getColumnModel().getColumn(1);
column1.setMaxWidth(0);
column1.setMinWidth(0);
column1.setWidth(0);
column1.setPreferredWidth(0);

is the answer, my search in the javaranch
"Invisible column in JTable" yeileded zero results...
then i searched for JTable...
i got the required answers...
thank all
vinaya
 
vinaya kumar
Ranch Hand
Posts: 70
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
this is the solution
TableColumn column1 = null;
column1 = table.getColumnModel().getColumn(1);
column1.setMaxWidth(0);
column1.setMinWidth(0);
column1.setWidth(0);
column1.setPreferredWidth(0);

is the answer, my search in the javaranch
"Invisible column in JTable" yeileded zero results...
then i searched for JTable...
i got the required answers...
thank all
vinaya
 
Wahid Sadik
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
vinaya kumar .. excellent solution
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!