This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes [B]How To Center/Position a showMessageDialog box?[/B] Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "[B]How To Center/Position a showMessageDialog box?[/B]" Watch "[B]How To Center/Position a showMessageDialog box?[/B]" New topic
Author

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

Rick Wallace
Greenhorn

Joined: Nov 18, 2006
Posts: 6
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

Joined: Jan 14, 2004
Posts: 1535
For JOptionPane, set the parentComponent argument to null.
Rick Wallace
Greenhorn

Joined: Nov 18, 2006
Posts: 6
Worked like a charm. Thanks.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [B]How To Center/Position a showMessageDialog box?[/B]