Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

[B]How To Center/Position a showMessageDialog box?[/B]

 
Rick Wallace
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to center and/or position a dialog box that by default is popping up right over the button that calls it.
Any help would be much appreciated.
Thank you.
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For JOptionPane, set the parentComponent argument to null.
 
Rick Wallace
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Worked like a charm. Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic