Article View: borland.public.jbuilder.java.swing
Article #12638Re: Setting Column Widths in JTable
From: Marc Maman
Date: Fri, 04 Dec 1998 00:00
Date: Fri, 04 Dec 1998 00:00
32 lines
1639 bytes
1639 bytes
Petr Srajer wrote:
> Marc Maman wrote:
>
> > The following code works fine with the applet viewer and also with
> > Netscape when run as an applet. However, it does not work with Sun's
> > Java plug-in for Netscape. Any ideas?
> >
> > final static String[] column_labels =
> > {
> > "COLUMNA", "COLUMNB", "COLUMNC", "COLUMND", "COLUMNE"
> > };
> > final static int[] column_widths =
> > {
> > 70, 70, 420, 70, 70
> > };
> >
> > for (int i=0; i<column_widths.length; i++)
> > {
> > TableColumn column = jTable1.getColumn( column_labels[
> > i ] );
> > column.setWidth( column_widths[i] );
> > }
>
> If you need help please specify more problem.(console listing , ...)
>
> Petr.
The console doesn't display any message. The problem is: the columns don't
get sized appropriately (i.e. they all show with the same width) as opposed
to when you run it with the applet viewer, where they all size
proportionally.
Technical Details
Message-ID:
<3667FB3D.F9103453@hypercon.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3666AEBB.4B3B8D34@hypercon.com> <3667A4E3.7EABC162@ais.cz>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,7cd3722a73fee868 X-Google-Attributes: gid111d45,public From: Marc Maman <marc_maman@hypercon.com> Subject: Re: Setting Column Widths in JTable Date: 1998/12/04 Message-ID: <3667FB3D.F9103453@hypercon.com> X-Deja-AN: 418635726 Content-Transfer-Encoding: 7bit References: <3666AEBB.4B3B8D34@hypercon.com> <3667A4E3.7EABC162@ais.cz> Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing