Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "columnwidth in JTable" Watch "columnwidth in JTable" New topic
Author

columnwidth in JTable

vinaya kumar
Greenhorn

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
vinaya
p.s Let me know if u require code.


vinaya kumar
Altaf Ahmad
Greenhorn

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
Greenhorn

Joined: Jan 15, 2002
Posts: 8
wow!
thanks a lot !
it works!
vinaya
 
 
subject: columnwidth in JTable
 
Similar Threads
2 columns both having unspecified widths
JTable column width
ideas wanted on making this custom JTable cell renderer more efficient
TableRenderer with multiple lines of text
JTable printing . . .