void () { myPanel.removeAll(); for (NavBarItem item : myPanel.getItems()) { myPanel.add(item); } myPanel.revalidate(); myPanel.repaint(); queueAfterAll(() -> myPanel.scrollSelectionToVisible(false), ID.SCROLL_TO_VISIBLE); }