classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] FYI: Change layout for javax.swing.JFileChooser


From: Roman Kennke
Subject: [cp-patches] FYI: Change layout for javax.swing.JFileChooser
Date: Wed, 01 Jun 2005 12:32:29 +0200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.2.1) Gecko/20021204

The JFileChooser should use BorderLayout instead of GridBagLayout for its main panel. Otherwise a bug like https://savannah.gnu.org/bugs/?func=detailitem&item_id=13244 is easily triggered.

The attached patch fixes that.

2005-06-01  Roman Kennke  <address@hidden>

       * javax/swing/plaf/basic/BasicFileChooserUI.java
       (installComponents): Changed layout of main panel from GridBagLayout
       to BorderLayout (as is the case in Suns JDK). This fixes
       bug#13244.

/Roman

Index: javax/swing/plaf/basic/BasicFileChooserUI.java
===================================================================
RCS file: 
/cvsroot/classpath/classpath/javax/swing/plaf/basic/BasicFileChooserUI.java,v
retrieving revision 1.2
diff -u -r1.2 BasicFileChooserUI.java
--- javax/swing/plaf/basic/BasicFileChooserUI.java      19 May 2005 11:48:30 
-0000      1.2
+++ javax/swing/plaf/basic/BasicFileChooserUI.java      1 Jun 2005 10:29:14 
-0000
@@ -1299,19 +1299,10 @@
     c.anchor = GridBagConstraints.EAST;
     bottomPanel.add(closePanel, c);
 
-    filechooser.setLayout(new GridBagLayout());
-
-    c.anchor = GridBagConstraints.WEST;
-    c.gridx = 0;
-    c.gridy = 0;
-    filechooser.add(topPanel, c);
-
-    c.gridy = 1;
-    filechooser.add(centrePanel, c);
-
-    c.gridy = 2;
-    c.fill = GridBagConstraints.HORIZONTAL;
-    filechooser.add(bottomPanel, c);
+    filechooser.setLayout(new BorderLayout());
+    filechooser.add(topPanel, BorderLayout.NORTH);
+    filechooser.add(centrePanel, BorderLayout.CENTER);
+    filechooser.add(bottomPanel, BorderLayout.SOUTH);
   }
 
   /**

reply via email to

[Prev in Thread] Current Thread [Next in Thread]