!7 import javax.swing.plaf.InternalFrameUI; import javax.swing.plaf.basic.BasicInternalFrameUI; module SeparateDesktopPaneSpike > DynSingleFunctionWithPrintLog { transient JDesktopPane desktopPane; void doIt { if (desktopPane != null) ret with moveBack(); final JInternalFrame myFrame = cast dm_frame(); if (myFrame == null) ret; Rectangle boundsOnScreen = boundsOnScreen(myFrame); desktopPane = jDesktopPane(); autoFixDesktopPane(desktopPane); showFrame(dm_moduleName(), desktopPane); setFrameBounds(desktopPane, boundsOnScreen); swing { removeFromParent(myFrame); onResizeAndNow(desktopPane, r { myFrame.setBounds(0, 0, desktopPane.getWidth(), desktopPane.getHeight()) }); desktopPane.add(myFrame); myFrame.setMaximum(true); myFrame.setMaximizable(false); myFrame.setClosable(false); myFrame.setIconifiable(false); InternalFrameUI ui = myFrame.getUI(); if (ui cast BasicInternalFrameUI) { ui.setNorthPane(null); } } } void moveBack ctex { if (desktopPane == null) ret; final JInternalFrame myFrame = cast dm_frame(); removeFromParent(myFrame); myFrame.updateUI(); myFrame.setMaximum(false); myFrame.setMaximizable(true); myFrame.setClosable(true); myFrame.setIconifiable(true); dm_desktopPane().add(myFrame); Rectangle bounds = rectangleFromScreenToComponent(boundsOnScreen(getFrame(desktopPane)), dm_desktopPane()); print("Setting bounds: " + bounds); myFrame.setBounds(bounds); fixInternalFrame(myFrame); myFrame.toFront(); myFrame.setSelected(true); print("Have bounds: " + getBounds(myFrame); disposeFrame(desktopPane); desktopPane = null; call(dm_getStem(this), 'enhanceFrame, myFrame); // re-add title menus } void cleanMeUp { disposeFrame(desktopPane); desktopPane = null; } }