Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to save a paragraph in a string

 
Subitha Sangar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to save a paragraph (multi line) in a string.. then im going to display that string as a showMessageDialog. My problem is i can save in a string as a single line or use the special symbol like \n or \t. if i do so i have to type every thing in a line.. how can i type is like a paragraph and then show the message.

String details = " fffffffffffffffffffffffffffffffff ffffffffffffffff
ffffffffffffffff fffffffff fffffffffffffff ffffffff"

JOptionPane.showMessageDialog(null,ab,"deatails",JOptionPane.INFORMATION_MESSAGE);
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

And if your string is long, whether or not is has newlines in it, you can break it up as follows.
 
Subitha Sangar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your idea Jeff.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic