boolean (@NotNull Component component) { Component owner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner(); if (owner == null) return false; if (SwingUtilities.isDescendingFrom(owner, component)) return true; while (component != null) { if (kindaHasFocus(component)) return true; component = component.getParent(); } return false; }