desktop = new JSLDesktop();
desktop = JSLDesktop.getInstance();
    public PatchEdit() {	/*	 * Initialize JFrame	 */        //super("JSynthLib");	// phil@muqus.com (so can pop-up windows with PatchEdit as the        //instance = this;	/*	 * Load config file (JSynthLib.properties).	 */	appConfig = new AppConfig();        boolean loadPrefsSuccessfull = appConfig.loadPrefs();	// Set up the GUI.	createActions();	desktop = new JSLDesktop();	desktop.setupInitialMenuBar(createToolBar());	if (MacUtils.isMac())	    initForMac(exitAction, prefsAction, aboutAction);	/*	 * Setup preference dialog window.	 */        prefsDialog = new PrefsDialog(desktop.getSelectedWindow());	// Add the configuration panels to the prefsDialog        prefsDialog.addPanel(new GeneralConfigPanel(appConfig));	prefsDialog.addPanel(new DirectoryConfigPanel(appConfig));	MidiConfigPanel midiConfigPanel = null;	midiConfigPanel = new MidiConfigPanel(appConfig);	midiConfigPanel.addDriverChangeListener(this);	prefsDialog.addPanel(midiConfigPanel);	MidiIn = MidiOut = midiConfigPanel.getMidiWrapper();	// FaderBoxConfigPanel() have to be called after MidiIn is initialized.	FaderBoxConfigPanel faderbox = new FaderBoxConfigPanel(appConfig);	midiConfigPanel.addDriverChangeListener(faderbox); // Notify the faderbox, too... - emenaker 2003.03.19	prefsDialog.addPanel(faderbox);	prefsDialog.addPanel(new NoteChooserConfigPanel(appConfig));	// Create preference dialog window and initialize each config	// panel.	prefsDialog.init();	// popup menu for Library window, etc.	menuPatchPopup = createPopupMenu();	/*	 * Show dialog for the 1st invokation.	 */        if (!loadPrefsSuccessfull)            ErrorMsg.reportError("Error",				 "Unable to load user preferences. Defaults loaded\n"				 + "If you've just installed or just upgraded this software, this is normal.");        //Set up a silly little dialog we can pop up for the user to        //gawk at while we do time consuming work later on.        waitDialog = new WaitDialog(desktop.getSelectedWindow());        // Start pumping MIDI information from Input --> Output so the        // user can play a MIDI Keyboard and make pretty music        beginEcho();    }