Layout bug

Kero van Gelder kero at d4050.upc-d.chello.nl
Wed Mar 21 15:54:30 PST 2001


Hm, patch attached now...

+--- Kero --------------------------------- kero at dds.nl ---+
|  Don't split your mentality without thinking twice       |
|                          Proud like a God -- Guano Apes  |
+--- M38c ------------------ http://huizen.dds.nl/~kero ---+
-------------- next part --------------
--- libraries/javalib/java/awt/oldGridLayout.java	Thu Mar 22 00:30:16 2001
+++ libraries/javalib/java/awt/GridLayout.java	Thu Mar 22 00:40:37 2001
@@ -108,13 +108,14 @@
 }
 
 public void layoutContainer ( Container parent) {
+	int nChildren = parent.getComponentCount(); // beware of Frame Menubars
+	if (nChildren == 0) return;
+
 	Insets in = parent.getInsets(); // getInsets() might be reimplemented (swing)
 	int tw = parent.width - in.left - in.right - hgap;
 	int th = parent.height - in.top - in.bottom - vgap;
 	
-	Dimension d = adjustDim( parent);
-	int nChildren = parent.getComponentCount(); // beware of Frame Menubars
-	
+	Dimension d = adjustDim( parent); // #rows & #columns
 	int cw = tw / d.width;
 	int ch = th / d.height;
 	


More information about the kaffe mailing list