/** * Called by about button. Raises about dialog. Currently the about box has * the product image and the copyright notice. The dialog box is centered * over the MainFrame. */ private void about() { JFrame mainFrame = GuiPackage.getInstance().getMainFrame(); JDialog dialog = initDialog(mainFrame); // NOTE: these lines center the about dialog in the current window. Point p = mainFrame.getLocationOnScreen(); Dimension d1 = mainFrame.getSize(); Dimension d2 = dialog.getSize(); dialog.setLocation(p.x + (d1.width - d2.width) / 2, p.y + (d1.height - d2.height) / 2); dialog.setVisible(true); }