!7 import javax.swing.plaf.InternalFrameUI; import javax.swing.plaf.basic.BasicInternalFrameUI; module SeparateDesktopPaneSpike > DynSingleFunctionWithPrintLog { void doIt { final JInternalFrame myFrame = cast dm_frame(); if (myFrame == null) ret; if (getParent(myFrame) != dm_desktopPane()) ret with moveBack(); Rectangle boundsOnScreen = boundsOnScreen(myFrame); final JDesktopPane 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 { final JInternalFrame myFrame = cast dm_frame(); if (myFrame == null) ret; JDesktopPane desktopPane = cast getParent(myFrame); if (desktopPane == dm_desktopPane()) ret; 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 } }