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]

[gui] Patch: javax.swing.JTextArea


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,


I just commited the attached patch to fix javax.swing.JTextArea's 
handling of properties.


Michael


2004-07-20  Michael Koch  <konqueror@gmx.de>

	* javax/swing/JTextArea.java
	(setLineWrap): Fire property change event after new value is set.
	(setTabSize): Likewise.
- -- 
Homepage: http://www.worldforge.org/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFA/S3+WSOgCCdjSDsRAnp6AJ4p3eVh6gsWIPE1rm+ETvfCX/QYoACfeROs
qei3gP6gvNdW6q91gNj9FaY=
=bMND
-----END PGP SIGNATURE-----
Index: javax/swing/JTextArea.java
===================================================================
RCS file: /cvs/gcc/gcc/libjava/javax/swing/JTextArea.java,v
retrieving revision 1.1.2.3
diff -u -b -B -r1.1.2.3 JTextArea.java
--- javax/swing/JTextArea.java	10 Jul 2004 12:15:18 -0000	1.1.2.3
+++ javax/swing/JTextArea.java	20 Jul 2004 14:31:12 -0000
@@ -227,8 +227,12 @@
    */
   public void setLineWrap(boolean flag)
   {
-    firePropertyChange("lineWrap", wrapping, flag);
+    if (wrapping == flag)
+      return;
+
+    boolean oldValue = wrapping;
     wrapping = flag;
+    firePropertyChange("lineWrap", oldValue, wrapping);
   }
 
   public int getTabSize()
@@ -238,7 +242,11 @@
 
   public void setTabSize(int newSize)
   {
-    firePropertyChange("tabSize", tabSize, newSize);
+    if (tabSize == newSize)
+      return;
+    
+    int oldValue = tabSize;
     tabSize = newSize;
+    firePropertyChange("tabSize", oldValue, tabSize);
   }
 }

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