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, w, h), contents); } 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) { final bool dontSelect = isTrue(addInternalFrame_dontSelect!); ret swing(func -> JInternalFrame { JInternalFrame frame = jInternalFrame(title); setInternalFrameContents(frame, contents); desktop.add(frame); if (r != null) setBounds(frame, r); else internalFrameDefaultPosition(frame); if (dontSelect) frame.toFront(); else frame.setSelected(true); ret fixInternalFrame(frame); }); } static JInternalFrame addInternalFrame(JDesktopPane desktop, S title) { ret addInternalFrame(desktop, title, jpanel()); }