/** * Handle the "about" action by displaying the "About Apache JMeter..." * dialog box. The Dialog Box is NOT modal, because those should be avoided * if at all possible. */ @Override public void doAction(ActionEvent e) { if (e.getActionCommand().equals(ActionNames.ABOUT)) { this.about(); } }
/** * 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); }