private @Nullable Component getVisibleComponent() {
    for (Component component : getComponents()) {
      if (component.isVisible()) return component;
    }
    return null;
  }
private @Nullable Component getVisibleComponent()