[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[cp-patches] FYI: JFileChooser fix
From: |
Roman Kennke |
Subject: |
[cp-patches] FYI: JFileChooser fix |
Date: |
Wed, 04 Jan 2006 23:26:16 +0000 |
Hi there,
when playing around with JFileChooser I noticed that with Sun's impl,
the filechooser always comes up with the same width, independent from
the size of the file list. Also, I noticed the (for a layout manager)
unusual width of exactly 500 of the content pane of the file manager
dialog (i.e. the JFileChooser component itself). I printed out a dump of
the component hierarchy for a JFileChooser dialog and saw that the
components involved (=the JFileChooser and subcomponents) have normal
layout managers set (many BorderLayouts) and no custom preferred size
set. This lead me to the conclusion, that they do not call pack() before
opening the dialog, but instead set the dialog size by setting a fixed
width (500) and the preferred height of the JFileChooser (as calculated
by the layout manager). (You might ask, don't they also set a fixed
height? I think not, 326 pixels do not seem like something you would
hardcode, no? I am not sure...) So I did it that way...
2006-01-04 Roman Kennke <address@hidden>
* javax/swing/JFileChooser.java
(showOpenDialog): Set fixed width on the dialog.
(showSaveDialog): Set fixed width on the dialog.
(showDialog): Set fixed width on the dialog.
/Roman
patch.diff
Description: Text Data
- [cp-patches] FYI: JFileChooser fix,
Roman Kennke <=