This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Center the Message in the JOptionPane

 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I would like to know how to center the message in the JOptionPane. If you do this


or



The message is still not placed in the center and it looks quite ugly. I can simply add some spaces to center the message, but it's not an elegant solution. Do you guys know a much better approach? Thanks in advance.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
may be a bit easier to roll-your-own

 
Freddy Wong
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Never thought of that. Thanks Michael
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic