classpath-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cp-patches] invalidate Label on setText


From: Thomas Fitzsimmons
Subject: [cp-patches] invalidate Label on setText
Date: Sat, 20 Aug 2005 23:58:43 -0400

Hi,

This patch fixes http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22956

When a label's text is set, it and its parent containers need to be
revalidated.

Tom

2005-08-20  Thomas Fitzsimmons  <address@hidden>

        * java/awt/Label.java (setText): Invalidate label.

Index: java/awt/Label.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/Label.java,v
retrieving revision 1.19
diff -u -r1.19 Label.java
--- java/awt/Label.java 2 Jul 2005 20:32:25 -0000       1.19
+++ java/awt/Label.java 21 Aug 2005 03:59:57 -0000
@@ -215,12 +215,16 @@
 public synchronized void
 setText(String text)
 {
-  this.text = text;
-
-  if (peer != null)
+  if (this.text != text)
     {
-      LabelPeer lp = (LabelPeer) peer;
-      lp.setText (text);
+      this.text = text;
+
+      if (peer != null)
+       {
+         LabelPeer lp = (LabelPeer) peer;
+         lp.setText (text);
+       }
+      invalidate();
     }
 }
 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]