Content (@NotNull JComponent component) { Content[] contents = getContents(); for (Content content : contents) { if (SwingUtilities.isDescendingFrom(component, content.getComponent())) { return content; } } return null; }