No, that doesn't help but thanks for the suggestion. I have found a
partial solution, but I don't know why my original method fails.
When I would change the host status I need to update the icon in
column 0. To do so I used the following code.
public void statusChanged(RemoteHost host)
{
tableModel.fireTableRowsUpdated(hosts.indexOf(host),
hosts.indexOf(host));
}
The call to fireTableRowsUpdated() is what messes up the column
widths. If I change this to a simple repaint() on the JTable the new
status is correctly displayed. Of course, listeners are not
notified, but I can handle that in other ways.
Isn't it the case that I should call fireTableRowsUpdated() when I
know the TableModel has new data to display?
At 9:06 AM +0000 4/25/01, Christian Pesch wrote:
>Bill Tschumy schrieb:
>
>> Why is the table allocating so much space to the column?
>
>How about trying to set the second column to be resizable?
>
>> column = getColumnModel().getColumn(0);
>> column.setPreferredWidth(20);
>> column.setMinWidth(20);
>> column.setMaxWidth(20);
>> column.setResizable(false);
>>
>> column = getColumnModel().getColumn(1);
>> column.setResizable(false);
>
>Set this to true. This might solve your resize problems,
>since for now the JTable has the problem, that according
>to the ColumnModel it is not allowed to resize but the container
>of the JTable donates it more spaces. Thus the JTable streches
>the columns on its own.
>
>--
>Christian Pesch - Software Engineer
>[EMAIL PROTECTED] - fon +49.40.325587.505 fax .999
>CoreMedia AG - www.coremedia.com - 0700-COREMEDIA
>Erste Brunnenstra�e 1, 20459 Hamburg, Germany
>
>CoreMedia - Think ahead! We're there.
--
Bill Tschumy
Otherwise -- Austin, TX
[EMAIL PROTECTED]
_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing