!7 import javax.swing.plaf.InternalFrameUI; import javax.swing.plaf.basic.BasicInternalFrameUI; module SeparateDesktopPaneSpike > DynSingleFunctionWithPrintLog { transient JDesktopPane desktopPane; transient Rect originalBounds; void doIt { if (desktopPane != null) ret with moveBack(); final JInternalFrame myFrame = cast dm_frame(); if (myFrame == null) ret; originalBounds = dm_getBounds(); 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); setBounds(myFrame, originalBounds); myFrame.updateUI(); dm_desktopPane().add(myFrame); fixInternalFrame(myFrame); myFrame.setSelected(true); myFrame.toFront(); myFrame.setMaximum(false); myFrame.setMaximizable(true); myFrame.setClosable(true); myFrame.setIconifiable(true); /*InternalFrameUI ui = myFrame.getUI(); if (ui cast BasicInternalFrameUI) { ui.setNorthPane(northPane); myFrame.revalidate(); }*/ disposeFrame(desktopPane); desktopPane = null; } void cleanMeUp { disposeFrame(desktopPane); desktopPane = null; } }