Index: java/awt/GridBagLayout.java =================================================================== RCS file: /cvsroot/classpath/classpath/java/awt/GridBagLayout.java,v retrieving revision 1.21 diff -u -r1.21 GridBagLayout.java --- java/awt/GridBagLayout.java 5 Aug 2005 17:16:52 -0000 1.21 +++ java/awt/GridBagLayout.java 18 Oct 2005 20:02:35 -0000 @@ -705,17 +705,20 @@ if (lastInCol.containsKey(new Integer(x))) { Component lastComponent = (Component) lastInRow.get(new Integer(x)); - GridBagConstraints lastConstraints = lookupInternalConstraints(lastComponent); - - if (lastConstraints.gridheight == GridBagConstraints.RELATIVE) + if (lastComponent != null) { - constraints.gridy = max_y - 1; - break; - } - else - { - constraints.gridy = Math.max (constraints.gridy, - lastConstraints.gridy + Math.max (1, lastConstraints.gridheight)); + GridBagConstraints lastConstraints = lookupInternalConstraints(lastComponent); + + if (lastConstraints.gridheight == GridBagConstraints.RELATIVE) + { + constraints.gridy = max_y - 1; + break; + } + else + { + constraints.gridy = Math.max (constraints.gridy, + lastConstraints.gridy + Math.max (1, lastConstraints.gridheight)); + } } } }