public void actionPerformed(ActionEvent e) { AboutDialog ad = new AboutDialog((DemoApp) SwingUtilities.getWindowAncestor(demo)); ad.setLocationRelativeTo(demo); ad.setVisible(true); }