Presetting column width in JTable without disabling autoresize?

From: Anton Golovko (odinodin_at_gmail.com)
Date: 03/22/05


Date: 22 Mar 2005 04:45:32 -0800

Hi!

Is there any way to preset column width in pixels wihtout disabling
auto resize in JTable?

Here is my situation:
1. The first column of the table needs to be preset to 30 pixels.
2. I don't want horizontal a scrollbar to appear.
3. I cannot use TableColumn.setMaxWidth, because I want user to be
able to resize column sizes.

TableColumn.setPreferredWidth doesn't work here, the table increases
the width of my column anyway.

Please help!

Regards,
Anton


Quantcast