my dog learned polymorphism
The moose likes Swing / AWT / SWT and the fly likes columnwidth in JTable Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "columnwidth in JTable" Watch "columnwidth in JTable" New topic

columnwidth in JTable

vinaya kumar

Joined: Jan 15, 2002
Posts: 8
Hello All,
I have table with 3 columns.
i want to set the columnwidth to dynamically,based on the screen size.
i.e i know what % of the screen size a column will take!
Based on these values and based on the screen size
i would like to set the values for columnWidth.
But my doubt is , for a column which has Boolean Class(checkbox),is there any minimum field width set.
This is because even if i make the column width to zero,the column is still displayed.
Thanks and Regards
p.s Let me know if u require code.

vinaya kumar
Altaf Ahmad

Joined: Apr 24, 2002
Posts: 13
TableColumn has a setMinWidth() method which governs the minimum width of columns. If you specify a value for the width which is less than the minimum width, then the minimum width is only as low as it'll go.
vinaya kumar

Joined: Jan 15, 2002
Posts: 8
thanks a lot !
it works!
I agree. Here's the link:
subject: columnwidth in JTable
jQuery in Action, 3rd edition