Bug 19860 - Swing JOptionPane and multiline texts
Summary: Swing JOptionPane and multiline texts
Status: RESOLVED FIXED
Alias: None
Product: classpath
Classification: Unclassified
Component: swing (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: 0.18
Assignee: Thomas Fitzsimmons
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-09 17:31 UTC by Norman Hendrich
Modified: 2005-10-16 01:47 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2005-05-14 21:08:17


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Norman Hendrich 2005-02-09 17:31:27 UTC
JOptionPane fails to render multiline text in the 'standard' dialogs.
Testcase attached; tested with gcc-4.0-20050130 snapshot and current
gui-branch-20040128 cvs. 

(the location of the JButtons is sub-optimal, too.)


/* MultilineJOptionPane.java
 *
 * demonstrates GCJ doesn't display multiple lines of text in a JOptionPane 
 *
 * (C) 2005 FNH
 */

import java.awt.*;
import javax.swing.*;

public class MultilineJOptionPane {

  public static void main( String args[] ) {
    JFrame frame = new JFrame( "just a frame" );
    frame.setSize(50,50);
    frame.show();

    String s =
      "The first line of text, five to follow...\n"
    + "A second line of text,\n"
    + "and the third,\n"
    + "fourth,\n"
    + "and fifth line of text. Click ok to exit.\n"
    ;

    JOptionPane.showMessageDialog( frame, s );

    System.exit( 0 );
  }

}
Comment 1 Andrew Pinski 2005-02-12 22:35:22 UTC
Confirmed.
Comment 2 Roman Kennke 2005-06-03 14:50:02 UTC
Should work, at least in GNU Classpath it does. I have fixed the JTextComponent
stuff so far that it can be used (e.g. in JOptionPanes).
Comment 3 Thomas Fitzsimmons 2005-06-03 15:13:12 UTC
OK, for stuff like this we'll wait until tromey's big merge is complete.  I
don't want to merge any Classpath gui work into libgcj at this point.
Comment 4 Anthony Balkissoon 2005-06-23 18:23:48 UTC
I patched this in classpath, merge should fix it.
Comment 5 Thomas Fitzsimmons 2005-08-24 19:29:41 UTC
Fixed.  Closing.