LibraryFrame libFrame = (LibraryFrame) oFrame; if (libFrame.getTitle().startsWith("Unsaved Library")) { saveFrameAs(); return; } libFrame.save();
saveFrame((LibraryFrame)oFrame, fn);
    private void saveFrame() {	try {	    Object oFrame = desktop.getSelectedFrame();	    if (oFrame instanceof LibraryFrame) {		LibraryFrame libFrame = (LibraryFrame) oFrame;		if (libFrame.getTitle().startsWith("Unsaved Library")) {		    saveFrameAs();		    return;		}		libFrame.save();	    } else if (oFrame instanceof SceneFrame) {		SceneFrame sceneFrame = (SceneFrame) oFrame;		if (sceneFrame.getTitle().startsWith("Unsaved ")) {		    saveFrameAs();		    return;		}		sceneFrame.save();	    }	} catch (Exception e) {	    ErrorMsg.reportError("Error", "Unable to Save Library", e);	    return;	}    }