> hi,
>
[quoted text clipped - 12 lines]
>
> nagesh
I use the technique you show in your example and it works fine for me. Here
is one of my examples:
JOptionPane.showMessageDialog(null, "This dialog should contain
the 'checkeredFlag.gif'\nwhich has no embedded blanks in its name.", "Jar
Test",
JOptionPane.INFORMATION_MESSAGE, aboutIcon);
The message wraps right after the 'checkeredFlag.gif', just as you would
hope. I can't think of a reason why this technique should fail for you.
Rhino
Nagesh - 04 Jan 2006 13:53 GMT
I could not understand what u r trying to say regarding
'checkeredFlag.gif'. What i understand is it is just a mark for break
line in the output. I could not succeed in any one of the above
tricks. It is intersting how html engine has come into the picture(in
context of ANdrew Thopson) . I thought it has nothing to do with java.
Rendering i mean it("\n") should make the next line to come as a new
line.
thanks,
Nagesh
Nagesh - 04 Jan 2006 14:08 GMT
I am very Sorry,
It is working if i give directly String object as argument but it does
not work if i add the text to JTextButton and add the text button as
argument. The JTextButton i had used for the purpose of dragging the
message I am showing.
i.e.
JTextField textButton = new JTextField("First line\n. Second
line\n.etc..... " );
textButton.setDragEnabled(true);
JOptionPane.showMessageDialog(null,textbutton);
thanks,
Nagesh
Nagesh - 04 Jan 2006 14:09 GMT
Sorry,
It is working if i give directly String object as argument but it does
not work if i add the text to JTextButton and add the text button as
argument. The JTextButton i had used for the purpose of dragging the
message I am showing.
i.e.
JTextField textButton = new JTextField("First line\n. Second
line\n.etc..... " );
textButton.setDragEnabled(true);
JOptionPane.showMessageDialog(null,textbutton);
thanks,
Nagesh
> I am trying to add multilines to JOptionPane.showMessageDialog.
Rhino showed one way. Here is another.
JLabel message = new JLabel("<html><body>Swing components<br>" +
"render HTML");
JOptionPane.showMessageDialog(null, message);
HTH

Signature
Andrew Thompson
physci, javasaver, 1point1c, lensescapes - athompson.info/andrew