List of usage examples for java.awt KeyboardFocusManager getActiveWindow
public Window getActiveWindow()
From source file:Main.java
public static Window getActiveWindow() { KeyboardFocusManager mgr = KeyboardFocusManager.getCurrentKeyboardFocusManager(); return mgr.getActiveWindow(); }
From source file:Main.java
/** * Tries to find the current focused window. * //from w w w . ja va 2s . co m * @return the current focused window, or <code>null</code> if no such window * could be found. */ public static final Window getCurrentWindow() { Window owner; final KeyboardFocusManager kbdFocusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager(); owner = kbdFocusManager.getFocusedWindow(); if (owner == null) { owner = kbdFocusManager.getActiveWindow(); } return owner; }