List of usage examples for java.awt Window requestFocus
public void requestFocus()
From source file:org.pgptool.gui.ui.tools.UiUtils.java
/** * Hack to make sure window is visible. On windows it's sometimes created but on * a background. User can see "flashing" icon in a task bar but window stays on * a background.//w w w . java2s. co m * * PRESUMING: setVisible(true) was already called * * More ion tihs jere: * http://stackoverflow.com/questions/309023/how-to-bring-a-window-to-the-front */ public static void makeSureWindowBroughtToFront(Window window) { // int state = dialog.getExtendedState(); // state &= ~JFrame.ICONIFIED; // dialog.setExtendedState(state); window.setAlwaysOnTop(true); window.toFront(); window.requestFocus(); window.setAlwaysOnTop(false); window.repaint(); }