!7 import javax.swing.plaf.InternalFrameUI; import javax.swing.plaf.basic.BasicInternalFrameUI; module SeparateDesktopPaneSpike > DynSingleFunctionWithPrintLog { transient JDesktopPane desktopPane; transient JComponent northPane; // frame title void doIt { if (desktopPane != null) ret with moveBack(); final JInternalFrame myFrame = cast dm_frame(); if (myFrame == null) ret; desktopPane = jDesktopPane(); autoFixDesktopPane(desktopPane); showFrame("Separate Frame", desktopPane); 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) { northPane = ui.getNorthPane(); ui.setNorthPane(null); } } } void moveBack ctex { if (desktopPane == null) ret; final JInternalFrame myFrame = cast dm_frame(); removeFromParent(myFrame); 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); } disposeFrame(desktopPane); desktopPane = null; } void cleanMeUp { disposeFrame(desktopPane); desktopPane = null; } }