public static void registerMacOSXApplication(MainFrame inApp) {
        if (mainApp != null) {
            throw new IllegalStateException("application already set");
        }

        mainApp = inApp;

        theApplication.addApplicationListener(theAdapter);

        theApplication.addPreferencesMenuItem();
    }
public static void registerMacOSXApplication ( MainFrame inApp ) { if ( mainApp != null ) { throw new IllegalStateException ( "application already set" ) ; } mainApp = inApp ; theApplication . addApplicationListener ( theAdapter ) ; theApplication . addPreferencesMenuItem ( ) ; }
reflection (see MyApp.java)