sbool activateFrame_v2(Component c, O... _) { ret swing(-> { 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() || isLinux())) { bool fullscreen = f.getExtendedState() == Frame.MAXIMIZED_BOTH; f.setExtendedState(JFrame.ICONIFIED); f.setExtendedState(fullscreen ? JFrame.MAXIMIZED_BOTH : JFrame.NORMAL); } f.toFront(); true; }); }