public static void preferences() { if (pref == null) { JFrame parent = null; if (window.isVisible()) { parent = window; } PrefPanel panel; if (prefclass == null) { panel = new PrefPanel(); } else { panel = (PrefPanel) newInstance(prefclass); } panel.setParentFrame(parent); int result = JOptionPane.showConfirmDialog( parent, panel, "Preferences", JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE, new ImageIcon()); if (result == JOptionPane.OK_OPTION) { panel.savePreferences(); } else { } } else { pref.setVisible(true); } }
public static void about() { Component parent = null; if (window.isVisible()) { parent = window; } AboutPanel panel; if (aboutclass == null) { panel = new AboutPanel(); } else { panel = (AboutPanel) newInstance(aboutclass); } JOptionPane.showMessageDialog( parent, panel, "About", JOptionPane.INFORMATION_MESSAGE, AboutImage()); }