This patch fixes bug #13419 concerning JOptionPane not showing
multi-line messages.  Patch is attached.

2005-06-17  Anthony Balkissoon  <[EMAIL PROTECTED]>
        * javax/swing/SwingUtilities.java:
        (layoutCompoundLabel): Added check for multi-line text.


-Tony
Index: javax/swing/SwingUtilities.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/SwingUtilities.java,v
retrieving revision 1.30
diff -u -r1.30 SwingUtilities.java
--- javax/swing/SwingUtilities.java     3 Jun 2005 11:55:28 -0000       1.30
+++ javax/swing/SwingUtilities.java     17 Jun 2005 18:36:42 -0000
@@ -848,8 +848,14 @@
       }
     else
       {
+        int fromIndex = 0;
         textR.width = fm.stringWidth(text);
         textR.height = fm.getHeight(); 
+        while (text.indexOf('\n', fromIndex) != -1)
+          {
+            textR.height += fm.getHeight();
+            fromIndex=text.indexOf('\n', fromIndex)+1;
+          }
       }
 
     // Work out the position of text and icon, assuming the top-left coord
_______________________________________________
Classpath-patches mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/classpath-patches

Reply via email to