public static void init(ApplicationListener listener) { instance = new MacUtils(); instance.addApplicationListener(listener); instance.setEnabledPreferencesMenu(true); }
static void init(final Action exitAction, final Action prefsAction, final Action aboutAction) { instance = new MacUtils(); instance.addApplicationListener(new ApplicationAdapter() { public void handleAbout(ApplicationEvent e) { final ActionEvent event = new ActionEvent(e.getSource(), 0, "About");   SwingUtilities.invokeLater(new Runnable() { public void run() { try { aboutAction.actionPerformed(event); } catch (Exception e) { ErrorMsg.reportStatus(e); } } }); e.setHandled(true); } public void handleOpenFile(ApplicationEvent e) { final File file = new File(e.getFilename()); SwingUtilities.invokeLater(new Runnable() { public void run() { try { Actions.openFrame(file); } catch (Exception e) { ErrorMsg.reportStatus(e); } } }); e.setHandled(true); } public void handlePreferences(ApplicationEvent e) { e.setHandled(true); final ActionEvent event = new ActionEvent(e.getSource(), 0, "Preferences"); SwingUtilities.invokeLater(new Runnable() { public void run() { try { prefsAction.actionPerformed(event); } catch (Exception e) { ErrorMsg.reportStatus(e); } } }); } public void handleQuit(ApplicationEvent e) { exitAction.actionPerformed(new ActionEvent(e.getSource(), 0, "Exit")); e.setHandled(true); } }); instance.setEnabledPreferencesMenu(true); }
  public static void init(ApplicationListener listener) {    instance = new MacUtils();    instance.addApplicationListener(listener);    instance.setEnabledPreferencesMenu(true);  }