Article View: borland.public.jbuilder.java.swing
Article #8237Re: JFileChooser size problem
From: Joi Ellis
Date: Thu, 05 Oct 2000 00:00
Date: Thu, 05 Oct 2000 00:00
63 lines
2960 bytes
2960 bytes
"John McGrath [TeamB]" wrote:
>
> On Sun, 01 Oct 2000 19:23:57 -0500, Joi Ellis wrote:
>
> > It looks like JFileChooser is forcing its initial size to
> > 500x300 and to hell with what I'm telling it...!
>
> It looks like you called that one right. The following code is from
> MetalFileChooserUI.java:
>
> // Preferred and Minimum sizes for the dialog box
> private static int PREF_WIDTH = 500;
> private static int PREF_HEIGHT = 300;
> private static Dimension PREF_SIZE = new Dimension(
> PREF_WIDTH, PREF_HEIGHT);
> :
> :
> public Dimension getPreferredSize(JComponent c) {
> return PREF_SIZE;
> }
>
> Other look-and-feels have different hard-coded sizes, but the size is
> hard coded in all of the standard look-and-feels.
Like, Buh?? Hello, Sun!
>
> This is pretty cheesy if you ask me. I cannot think of any reason why
> the FileChooserUI implementations could not have sized the dialog based
> on a minimum size for the file list and the preferred size of the
> accessory.
Will you be having Cheddar or Baby Swiss with that, Sir?
> The only way that I can think to deal with it, save writing your own UI
> delegate classes, is to set the preferred size for the JFileChooser. But
> the size you will need will be different for different look-and-feels, so
> the best you can do is to select a different size depending on the name
> of the look-and-feel.
I'm pretty sure I tried that but I spun the tread off so many wheels I couldn't
swear to anything, now. I could try getting the preferred size and increasing it
by some amount.
>
> If I think of something better, I will let you know.
I wonder what Jim Cook did for his multifile tool? I don't think it
suffers from this issue, but then he's using a custom JFileChooser
with the multifile select issue fixed, too.
Hey, Jim! Could you share your expertise?
--
Joi Ellis Software Engineer
Aravox Technologies joi@aravox.com, gyles19@visi.com
No matter what we think of Linux versus FreeBSD, etc., the one thing I
really like about Linux is that it has Microsoft worried. Anything
that kicks a monopoly in the pants has got to be good for something.
- Chris Johnson
Technical Details
Message-ID:
<39DCAF46.691AA246@aravox.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<39D7D59D.176E4FA5@aravox.com> <MPG.1445eb857969656e989bd0@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,2f241fe4201eef13 X-Google-Attributes: gid111d45,public From: Joi Ellis <joi@aravox.com> Subject: Re: JFileChooser size problem Date: 2000/10/05 Message-ID: <39DCAF46.691AA246@aravox.com> X-Deja-AN: 677938763 Content-Transfer-Encoding: 7bit References: <39D7D59D.176E4FA5@aravox.com> <MPG.1445eb857969656e989bd0@forums.borland.com> To: "John McGrath [TeamB]" <ng-b@JPMcGrath.net> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Aravox Technologies Mime-Version: 1.0 Reply-To: joi@aravox.com Newsgroups: borland.public.jbuilder.java.swing