diff --git a/src/main/groovy/swing/SwingBuilder.java b/src/main/groovy/swing/SwingBuilder.java
index <HASH>..<HASH> 100644
--- a/src/main/groovy/swing/SwingBuilder.java
+++ b/src/main/groovy/swing/SwingBuilder.java
@@ -246,7 +246,11 @@ public class SwingBuilder extends BuilderSupport {
                 }
                 else if (parent instanceof RootPaneContainer) {
                     RootPaneContainer rpc = (RootPaneContainer) parent;
-                    rpc.getContentPane().add(component);
+                    if (constraints != null) {
+                    	rpc.getContentPane().add(component, constraints);
+                    } else {
+                    	rpc.getContentPane().add(component);
+                    }
                 }
                 else if (parent instanceof JScrollPane) {
                     JScrollPane scrollPane = (JScrollPane) parent;
Fix bug: could not add components to root pane with constraints. Now you can.


git-svn-id: <URL>