This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: FYI: fix Component.show


Hello,

I committed this as obvious.

Tom

2004-01-21  Thomas Fitzsimmons  <fitzsim@redhat.com>

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


Index: java/awt/Component.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/awt/Component.java,v
retrieving revision 1.31
diff -u -r1.31 Component.java
--- java/awt/Component.java	12 Nov 2003 22:03:49 -0000	1.31
+++ java/awt/Component.java	22 Jan 2004 00:21:30 -0000
@@ -869,9 +869,14 @@
    */
   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;
   }
 
   /**



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]