public void centerDialogInFrame(Dialog dialog, Frame frame)
    {
        dialog.setLocation(frame.getX() + (frame.getWidth() - dialog.getWidth()) / 2, frame.getY() + (frame.getHeight() - dialog.getHeight()) / 2);
    }
public void centerDialogInFrame ( Dialog dialog , Frame frame ) { dialog . setLocation ( frame . getX ( ) + ( frame . getWidth ( ) - dialog . getWidth ( ) ) / 2 , frame . getY ( ) + ( frame . getHeight ( ) - dialog . getHeight ( ) ) / 2 ) ; }
Center this dialog in the frame.