🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: JTable resizing

#8645
From: Paul H. van Rossem
Date: Sat, 05 Aug 2000 00:00
46 lines
2281 bytes
Hi Michael,

I think that this is caused by the JdbTable (or may be
Column.setWidth() called internally),  
which overrides the preferredWidth with an absolute value.
This effectively kills all methods inheritred from JTable
and further up that have to do with auto resizing the 
column widths when the table is resized after its container 
is resized. 

Unless I missed something, this JdbTable really violates 
the Java approach to component sizing, as a lot of effort 
has been put in the JTable to get this right (doLayout(), 
setPreferredWidth(), sizeColmumnsToFit(), etc.). Also
using a JdbTable in GridBagLayout doesn't work anymore
as expected.

In conclusion, I don't think there is a solution to this problem,
unless you build your own JdbTable subclass or until Borland 
provides a better one.

Regards, Paul

On Fri, 4 Aug 2000 09:10:14 +0200, in borland.public.jbuilder.java.swing you
wrote:

>How does I get the JTable to fill all the area in a JScrollPane, instead of
>hanging in the one side, until the user resizes a row?
>
>My JTable gets its datamodel after it have been inserted into the
>JScrollPane.
>I have tried to use
>  myJScollPane.getViewport().setPreferredSize(new Dimension(1600,800));
>  myJTable().setPreferredScrollableViewportSize(new Dimension(1600,800));
>
>They works sometimes, but not allways. My program is an Applet with variable
>height and width.
>
>MH
>

------------------------------------
Paul van Rossem, Van Rossem TimeWare
Tempellaan  18,  3721  VH  Bilthoven
tel: 030-220.4006, fax: 030-220.3445
mobiel: 06-5468.3405
Technical Details
Message-ID: <g0onos4ic81m5gslvmflp8u0p5dehbp2kp@4ax.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <398a6a25_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,2805815c15a9b277
X-Google-Attributes: gid111d45,public
From: Paul H. van Rossem <paul@timeware.nl>
Subject: Re: JTable resizing
Date: 2000/08/05
Message-ID: <g0onos4ic81m5gslvmflp8u0p5dehbp2kp@4ax.com>
X-Deja-AN: 654715927
Content-Transfer-Encoding: 7bit
References: <398a6a25_2@dnews>
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: abuse@xs4all.nl
X-Trace: news1.xs4all.nl 965468529 2411 194.109.150.51 (5 Aug 2000 09:42:09 GMT)
Organization: Van Rossem Timeware
Mime-Version: 1.0
NNTP-Posting-Date: 5 Aug 2000 09:42:09 GMT
Newsgroups: borland.public.jbuilder.java.swing