List of usage examples for javax.swing FocusManager getCurrentManager
public static FocusManager getCurrentManager()
KeyboardFocusManager
instance for the calling thread's context. From source file:Main.java
/** * Returns whether component or any of its children has focus or not. * * @param component/*from w ww . j a va 2 s.c o m*/ * component to process * @return true if component or any of its children has focus, false * otherwise */ public static boolean hasFocusOwner(final Component component) { final Component focusOwner = FocusManager.getCurrentManager().getFocusOwner(); return component == focusOwner || component instanceof Container && ((Container) component).isAncestorOf(focusOwner); }
From source file:net.landora.video.utils.UIUtils.java
public static Component getActiveWindow() { return FocusManager.getCurrentManager().getActiveWindow(); }