Making JTable respect TableColumn preferredWidths
Hi,
Is there any way of making the JTable always respect the preferredWidths set in the TableColumn of the TableModel.
Upon looking into the Source code of JTable, i found a private method in doLayout called setWidthsFromPreferredWidths which redistributes the columns based on the total JTable width.
One thing I found unusal is that it also updates the original preferred column widths we set in the model.
Thanks,
On Ali
[460 byte] By [
on_alia] at [2007-11-26 18:40:26]

# 3
> no. I have set AutoResize OFF. still that method changes the preferred widths.
No it doesn't.
If you need further help then you need to create a [url http://homepage1.nifty.com/algafield/sscce.html]Short, Self Contained, Compilable and Executable, Example Program[/url] (SSCCE) that demonstrates the incorrect behaviour, because I can't guess exactly what you are doing based on the information provided.
And don't forget to use the [url http://forum.java.sun.com/help.jspa?sec=formatting]Code Formatting Tags[/url] so the code retains its original formatting.