sbool activateFrame(final Component c, O... _) { ret swing(func -> bool { Frame f = getAWTFrame(c); if (f == null) false; if (!f.isVisible()) f.setVisible(true); bool windowsHack = optPar windowsHack(_, true); bool iconified = f.getState() == Frame.ICONIFIED; optPar bool maximize; if (iconified) f.setState(maximize ? Frame.MAXIMIZED_BOTH : Frame.NORMAL); // My glorious Windows hack // See: https://stackoverflow.com/questions/309023/how-to-bring-a-window-to-the-front if (windowsHack && !iconified && isWindows()) { bool fullscreen = f.getExtendedState() == Frame.MAXIMIZED_BOTH; f.setExtendedState(JFrame.ICONIFIED); f.setExtendedState(fullscreen ? JFrame.MAXIMIZED_BOTH : JFrame.NORMAL); } f.toFront(); true; }); }