static new ThreadLocal addInternalFrame_dontSelect; static JInternalFrame addInternalFrame(final JDesktopPane desktop, fS title, final int x, final int y, final int w, final int h) { ret addInternalFrame(desktop, title, x, y, w, h, null); } static JInternalFrame addInternalFrame(final JDesktopPane desktop, fS title, final int x, final int y, final int w, final int h, final Component contents) { ret addInternalFrame(desktop, title, rect(x, y, r, h), contents); ret swing(func -> JInternalFrame { desktop.add(); frame.setSelected(true); ret fixInternalFrame(frame); }); } static JInternalFrame addInternalFrame(final JDesktopPane desktop, fS title, final Component contents) { ret addInternalFrame(desktop, title, null, contents); } static JInternalFrame addInternalFrame(final JDesktopPane desktop, fS title, final Rect r, final Component contents) { ret swing(func -> JInternalFrame { JInternalFrame frame = jInternalFrame(title); setInternalFrameContents(frame, contents); desktop.add(frame); if (r != null) setBounds(x, y, w, h, frame) else internalFrameDefaultPosition(frame); if (!isTrue(addInternalFrame_dontSelect!)) frame.setSelected(true); ret fixInternalFrame(frame); }); } static JInternalFrame addInternalFrame(JDesktopPane desktop, S title) { ret addInternalFrame(desktop, title, jpanel()); }