void (JComponent c) { assertDispatchThread(); if (c == null) { return; } Window window = ComponentUtil.getParentOfType((Class<? extends Window>)Window.class, (Component)c); if (window != null && window.isShowing()) { doWhenFocusSettlesDown(() -> { if (ApplicationManager.getApplication().isActive()) { if (window instanceof JFrame && ((JFrame)window).getState() == Frame.ICONIFIED) { ((JFrame)window).setState(Frame.NORMAL); } else { window.toFront(); } } }); } }