boolean (JComponent component) { Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); if (owner == null) return false; return SwingUtilities.isDescendingFrom(owner, component); }