svoid stefansOS_popOutModule(final Module m) { final JInternalFrame myFrame = cast getPossiblyInternalFrame(m.vis); if (myFrame == null) ret; if (getParent(myFrame) != main.desktop) ret; // popped out already Rectangle boundsOnScreen = boundsOnScreen(myFrame); final JDesktopPane desktopPane = jDesktopPane(); autoFixDesktopPane(desktopPane); showFrame(m.moduleName(), desktopPane); if (!frameTitlePopupMenuItem(f, "Pop Back In", r { stefansOS_popInModule(m) })) // can't add title menu - add button instead replaceComponent(desktopPane, func(JComponent dp) -> Component { withRightAlignedButtons(dp, "Pop Back In", r { stefansOS_popInModule(m) }) }); 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); } } }