File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 Murach's Java Servlets and JSP this week in the Servlets 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
 
I agree. Here's the link: http://aspose.com/file-tools
 
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 . . .