Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Making JTable columns to resize to fit text

Status
Not open for further replies.

SSJ

Programmer
Sep 26, 2002
54
PT
I'm trying to make a JTable to automatically set their column widths to automatically fit the text that will be displayed on them. I'm not speaking about the auto resize mode.
For example lets say one of my columns is a description or something and can have for example 16 chars length, the other column is just a boolean value that will be rendered by a check box. So the first column should be much larger than the second.

Does Swing have any methods to determine each column maximum size and correctly adjust the Column size accordingly? Or is the only way to do it, to pre-define fixed widths for each column?

TIA
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top