FocusListener (@NotNull ToolWindow toolWindow) { return new FocusListener() { @Override public void focusGained(FocusEvent e) { JComponent component = getComponentToFocus(toolWindow); if (component != null) { component.requestFocusInWindow(); } } @Override public void focusLost(FocusEvent e) { } }; }