JSLFrame[] jList = JSLDesktop.getAllFrames(); for (int j = 0; j < jList.length; j++) { if (jList[j] instanceof BankEditorFrame) { for (int i = 0; i < myModel.getRowCount(); i++) if (((BankEditorFrame) (jList[j])).bankData == myModel.getPatchAt(i)) { jList[j].moveToFront(); try { jList[j].setSelected(true); jList[j].setClosed(true); } catch (Exception e1) { ErrorMsg.reportStatus(e1);
JSLFrame[] jList = JSLDesktop.getAllFrames(); for (int j = 0; j < jList.length; j++) { if (jList[j] instanceof BankEditorFrame) { for (int i = 0; i < myModel.getRowCount(); i++) if (((BankEditorFrame) (jList[j])).bankData == myModel .getPatchAt(i)) { jList[j].moveToFront(); try { jList[j].setSelected(true); jList[j].setClosed(true); } catch (Exception e1) { ErrorMsg.reportStatus(e1); } break; }
    public void JSLFrameClosing(JSLFrameEvent e) {        if (!changed) return;        // close Patch/Bank Editor editing a patch in this frame.        JSLFrame[] jList = JSLDesktop.getAllFrames();        for (int j = 0; j < jList.length; j++) {        if (jList[j] instanceof BankEditorFrame) {            for (int i = 0; i < myModel.getRowCount(); i++)            if (((BankEditorFrame) (jList[j])).bankData                == myModel.getPatchAt(i)) {                jList[j].moveToFront();                try {                jList[j].setSelected(true);                jList[j].setClosed(true);                } catch (Exception e1) {                ErrorMsg.reportStatus(e1);                }                break;            }        }        if (jList[j] instanceof PatchEditorFrame) {            for (int i = 0; i < myModel.getRowCount(); i++)            if (((PatchEditorFrame) (jList[j])).p == myModel.getPatchAt(i)) {                jList[j].moveToFront();                try {                jList[j].setSelected(true);                jList[j].setClosed(true);                } catch (Exception e1) {                ErrorMsg.reportStatus(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;        moveToFront();        Actions.saveFrame();    }