Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Carriage return in a JOptionPane  RSS feed

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all. I am trying to show some system properties in a JOptionPane using showMessageDialog(). Does anyone know how to insert a carriage return into my message string? I tried using "\r" but that was displayed as ◘ in the output. Any ideas?
Nick
 
Glen Tanner
Ranch Hand
Posts: 147
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try \n
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found out that the JOptionPane supports an array of Objects as an argument and it stacks the elements of the array vertically in the output dialog.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!