JSLFrame[] jList =PatchEdit.desktop.getAllFrames();
JSLFrame[] jList =JSLDesktop.getAllFrames();
            public void JSLFrameClosing(JSLFrameEvent e) {                if (!changed) return;                int i;                JSLFrame[] jList =PatchEdit.desktop.getAllFrames();                for (int j=0;j<jList.length;j++) {                    if (jList[j] instanceof BankEditorFrame) {                        for (i=0;i<myModel.sceneList.size();i++)                            if (((BankEditorFrame)(jList[j])).bankData==((Scene)myModel.sceneList.get(i)).getPatch()) {				jList[j].moveToFront();				try {				    jList[j].setSelected(true);				    jList[j].setClosed(true);				} catch (Exception e1) {				}				break;			    }                    }                    if (jList[j] instanceof PatchEditorFrame) {                        for (i=0;i<myModel.sceneList.size();i++)                            if (((PatchEditorFrame)(jList[j])).p==((Patch)(myModel.sceneList.get(i)))) {				jList[j].moveToFront();				try {				    jList[j].setSelected(true);				    jList[j].setClosed(true);				} catch (Exception e1) {				}				break;			    }                    }                }                if (JOptionPane.showConfirmDialog(null,"This Scene may contain unsaved data.\nSave before closing?","Unsaved Data",JOptionPane.YES_NO_OPTION) == JOptionPane.NO_OPTION) return;                if (getTitle().startsWith("Unsaved Scene")) {                    CompatibleFileDialog fc2 = new CompatibleFileDialog();                    ExtensionFilter type1 = new ExtensionFilter("PatchEdit Scene Files (*.scenelib)", ".scenelib");                    fc2.addChoosableFileFilter(type1);                    fc2.setFileFilter(type1);                    if (fc2.showSaveDialog(null) == JFileChooser.APPROVE_OPTION) {                        File file = fc2.getSelectedFile();                        try {                            if (!file.getName().toUpperCase().endsWith(".SCENELIB"))                                file=new File(file.getPath()+".scenelib");                            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;                            save(file);                        } catch (Exception ex) {                            ErrorMsg.reportError("Error", "Error saving File",ex);                        }                    }                    return;                }                try {                    save();                } catch (Exception ex)                {};            }