fc2.setCurrentDirectory (new File (prefsDialog.libPath));
fc2.setCurrentDirectory (new File (appConfig.getLibPath()));
    protected void saveFrameAs ()    {        JFileChooser fc2=new JFileChooser ();        javax.swing.filechooser.FileFilter type1 = new ExtensionFilter ("PatchEdit Library Files",".patchlib");        fc2.setCurrentDirectory (new File (prefsDialog.libPath));        fc2.addChoosableFileFilter (type1);        fc2.setFileFilter (type1);        int returnVal = fc2.showSaveDialog (PatchEdit.this);        if (returnVal == JFileChooser.APPROVE_OPTION)        {            File file = fc2.getSelectedFile ();            try            {                if (desktop.getSelectedFrame ()==null)                {ErrorMsg.reportError ("Error", "Unable to Save Library. Library to save must be focused");                }                else                {                    if (!file.getName ().toUpperCase ().endsWith (".PATCHLIB"))                        file=new File (file.getPath ()+".patchlib");                    if (file.isDirectory ())                    { ErrorMsg.reportError ("Error", "Can not Save over a Directory");                      return;                    }                    if (file.exists ())                        if (JOptionPane.showConfirmDialog (null,"Are you sure?","File Exists",JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION) return;                    try {                    ((LibraryFrame)desktop.getSelectedFrame ()).save (file);                       } catch (Exception pr)                       {                         ((PerformanceFrame)desktop.getSelectedFrame()).save(file);                       }                }            } catch (Exception ex)            {ErrorMsg.reportError ("Error", "Unable to Save Library",ex);}                    }    }