code: protected void scrollForward() {
          int selectedIndex = tabPane.getSelectedIndex();
  
          if (++selectedIndex >= tabPane.getTabCount()) {
              tabPane.setSelectedIndex(tabPane.getTabCount() - 1);
          } else {
              tabPane.setSelectedIndex(selectedIndex);
          }
  
          tabPane.repaint();
      }
docs: Scroll the tab buttons forwards.