Component.java (show): Set visible to true before showing the peer.
authorThomas Fitzsimmons <fitzsim@redhat.com>
Thu, 22 Jan 2004 00:22:27 +0000 (00:22 +0000)
committerThomas Fitzsimmons <fitzsim@gcc.gnu.org>
Thu, 22 Jan 2004 00:22:27 +0000 (00:22 +0000)
2004-01-21  Thomas Fitzsimmons  <fitzsim@redhat.com>

* java/awt/Component.java (show): Set visible to true before
showing the peer.

From-SVN: r76325

libjava/ChangeLog
libjava/java/awt/Component.java

index 995aad906e1db2f94050609e414cffd3c441c51b..4b38db9b364973bfdeedea09696b89c4d8bf2e07 100644 (file)
@@ -1,3 +1,8 @@
+2004-01-21  Thomas Fitzsimmons  <fitzsim@redhat.com>
+
+       * java/awt/Component.java (show): Set visible to true before
+       showing the peer.
+
 2004-01-21  Kim Ho  <kho@redhat.com>
 
        * gnu/java/awt/peer/gtk/GtkFramePeer.java (postConfigureEvent):
index 9c93bd0a52783af1e382e90fcb1b25096cf1518f..94b74a6fdda349ea8741242c623ff71eb07c06fe 100644 (file)
@@ -869,9 +869,14 @@ public abstract class Component
    */
   public void show()
   {
+    // We must set visible before showing the peer.  Otherwise the
+    // peer could post paint events before visible is true, in which
+    // case lightweight components are not initially painted --
+    // Container.paint first calls isShowing () before painting itself
+    // and its children.
+    this.visible = true;
     if (peer != null)
       peer.setVisible(true);
-    this.visible = true;
   }
 
   /**