Don't create peers for added components if the container doesn't have a
peer yet!

2005-08-14  Sven de Marothy  <[EMAIL PROTECTED]>

        * java/awt/Container.java
        (addImpl): Call addNotify() only if the container has a peer.


Index: java/awt/Container.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Container.java,v
retrieving revision 1.59
diff -U3 -r1.59 Container.java
--- java/awt/Container.java	12 Aug 2005 11:46:54 -0000	1.59
+++ java/awt/Container.java	13 Aug 2005 22:53:17 -0000
@@ -341,11 +341,11 @@
           comp.parent.remove(comp);
         comp.parent = this;
 
-        // Notify the component that it has a new parent.
-        comp.addNotify();
-
         if (peer != null)
           {
+	    // Notify the component that it has a new parent.
+	    comp.addNotify();
+
             if (comp.isLightweight ())
 	      {
 		enableEvents (comp.eventMask);
_______________________________________________
Classpath-patches mailing list
Classpath-patches@gnu.org
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to