Article View: borland.public.jbuilder.java.swing
Article #12508Re: Setting Column Widths in JTable
From: Marc Maman
Date: Wed, 16 Dec 1998 00:00
Date: Wed, 16 Dec 1998 00:00
47 lines
2033 bytes
2033 bytes
I tried it with no luck.
Marc
Vasudevan Srinivasan wrote:
> Try settin the minwidth also.
> like
> columns[i].setMinWidth(x);
> columns[i].setWidth(x);
>
> Vasu
>
> Marc Maman wrote:
>
> > 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:
<3677C77F.1834EEEB@hypercon.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3666AEBB.4B3B8D34@hypercon.com> <3667A4E3.7EABC162@ais.cz> <3667FB3D.F9103453@hypercon.com> <366C2778.E672E84D@netrisk.com>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/16 Message-ID: <3677C77F.1834EEEB@hypercon.com> X-Deja-AN: 422888211 Content-Transfer-Encoding: 7bit References: <3666AEBB.4B3B8D34@hypercon.com> <3667A4E3.7EABC162@ais.cz> <3667FB3D.F9103453@hypercon.com> <366C2778.E672E84D@netrisk.com> Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.swing