}
add(southpan, BorderLayout.SOUTH);
setSize(Toolkit.getDefaultToolkit().getScreenSize());
pack();
Dimension msgsize = messagepanel.getSize();
setSize(msgsize.width+8, msgsize.height+9);
pack();
/* Center the dialog over its parent component.
*/
Dimension ourSize = getSize();
if (_ownerComponent != null) {
Point ownerOrigin = _ownerComponent.getLocationOnScreen();
Dimension ownerSize = _ownerComponent.getSize();
Point ownerCenter = ownerOrigin.addOffset(
ownerSize.width/2, ownerSize.height/2);
setLocation(ownerCenter.addOffset(
-ourSize.width/2, -ourSize.height/2));
}
else {
/* The parent component was not specified. Center this
* dialog box in the middle of the screen.
*/
Dimension screensize =
Toolkit.getDefaultToolkit().getScreenSize();
Point screenCenter = new Point(screensize.width/2,
screensize.height/2);
setLocation(screenCenter.addOffset(
-ourSize.width/2, -ourSize.height/2));