permaculture playing cards*
The moose likes Swing / AWT / SWT and the fly likes Varying Table column width ! 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 "Varying Table column width !" Watch "Varying Table column width !" New topic
Author

Varying Table column width !

Shivaji Bhosale
Ranch Hand

Joined: Mar 12, 2001
Posts: 70
I am creating a table. Individual Column widths are varying. So is there anyway
when row is getting displayed column with is adjusted automatically for changing width?
waiting impatiently ...
eric moon
Ranch Hand

Joined: Nov 26, 2000
Posts: 133
You need to override getColumnWidth. Here's how I did it. Whenever I call fireTableDataChanged() I make a call to setColumnWidths():

If you want the table to fit its contents you can put some code like this in your table:



[This message has been edited by eric moon (edited November 06, 2001).]


<BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>"Those who cast the votes decide nothing. Those who count the<BR>votes decide<BR>everything." <BR> -Joseph Stalin<HR></BLOCKQUOTE>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Varying Table column width !
 
Similar Threads
IllegalArgumentException when using clj-record's create function
JFace 3.3 Problem
Multiple Selection boxes of same width
Need Help in Internationalization
table with fixed column size?