How can I set the width of a JTable column?

Betty Pang

Try the following:


table.getColumn(columnID).setMaxWidth(idealWidth); 
table.getColumn(columnID).setMinWidth(idealWidth); 
table.getColumn(columnID).setWidth(idealWidth); 
table.getColumn(columnID).setPreferredWidth(idealWidth); 
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact