🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #11311

Re: JTable setWidth method problem

#11311
From: Vasudevan Srinivasan
Date: Fri, 18 Jun 1999 00:00
27 lines
1341 bytes
Try using
tableColumn.setMinimmWidth(width);
tableColumn.setWidth(width);
tableColumn.setMaximumWidth(width);

this is the usual trick to hide columns (when width=0), so it may work for
fixing columnwidth also.

Vasu


Richard Eber wrote:

> Anyone else out there having problems with the setWidth method of a JTable
> component?
>
> My columns are not resizing so I backed off and used the TableExample4.java
> code I found in the Swing sample directories that came with JBuilder2
> Professional. In that source file there is a line:
>
> vegetarianColumn.setWidth(35);
>
> Changing 35 to other values does not vary the displayed column width either.
> Any insight from anyone would be appreciated.
>
> Thanks in advance,
> Rich Eber
Technical Details
Message-ID: <376A50DC.E8A3CD7C@netrisk.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7jkbhs$4e915@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,9480b7d52f4b8d54
X-Google-Attributes: gid111d45,public
From: Vasudevan Srinivasan <vasudevan@netrisk.com>
Subject: Re: JTable setWidth method problem
Date: 1999/06/18
Message-ID: <376A50DC.E8A3CD7C@netrisk.com>
X-Deja-AN: 491065119
Content-Transfer-Encoding: 7bit
References: <7jkbhs$4e915@forums.borland.com>
To: Richard Eber <reber@hei.com>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: NetRisk Inc
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing