public void setSelectedComponent(@NotNull Component component) {
    rebuild(component);
    revalidate();
    repaint();
    SwingUtilities.invokeLater(() -> scrollToLastItem());
  }
public void setSelectedComponent(@NotNull Component component)