Mailingliste - Einträge 2005


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [qftestJUI] Setting a table columnwidth width SUT-Script


  • Subject: Re: [qftestJUI] Setting a table columnwidth width SUT-Script
  • From: Gregor Schmid <Gregor.Schmid@?.de>
  • Date: Tue, 01 Feb 2005 14:43:08 -0000

Hello Horst,

I've tried your code and don't get an exception, but I don't get any
effect either.

The Java API docs for TableColumn.setWidth says:

This method should not be used to set the widths of columns in the
JTable - use, setPreferredWidth() instead.

And indeed, setPreferredWidth appears to have the desired effect.

Best regards,
    Greg

"Weimann Horst" <Horst.Weimann@?.de> writes:

>    Hi all,
>
>
>    Consider the following problem:
>
>
>    We are trying to change the columnwidth for a JTable via a SUT-Script.
>
>    Getting the columnwidth just works fine, but adjusting the width to a
>    new  value fails with a NPE.
>
>
>    Any ideas what´s going wrong?
>
>
>    Example Script:
>
>    ----------------------------------------------------------------------
>    ---------------------------------------
>
>    table = rc.getComponent("ID_Of_Component")
>
>    oldWidth = table.getColumnModel().getColumn(0).getWidth()
>
>    newWidth = table.getColumnModel().getColumn(0).setWidth(oldWidth * 2)
>
>    table.revalidate()
>
>    table.repaint()
>
>    ----------------------------------------------------------------------
>    ---------------------------------------
>
>
>
>    Regards
>
>
>    Horst Weimann
>
>
>    CURSOR Software AG
>    Friedrich-List-Strasse 31
>    35398 Giessen
>
>    Tel.      (+49) (0) 6 41/4 00 00 -800       horst.weimann@?.de
>    Fax      (+49) (0) 6 41/4 00 00 -666       [1]http://www.cursor.de
>    ----------------------------------------------------------------------
>    -----------------------------------
>    Unsere Kundenunterstützung : [2]Support@?.de  oder Tel. (+49) (0)
>    641/40000 -911
>
> References
>
>    1. http://www.cursor.de/
>    2. mailto:Support@?.de

--
Gregor Schmid                                Gregor.Schmid@?.de
Quality First Software GmbH                     http://www.qfs.de
Tulpenstr. 41                                Tel: +49 8171 919870
DE-82538 Geretsried                          Fax: +49 8171 919876



Videos Downloads Dokumentation Kaufen Gratis Testen