code: protected void scrollBackward() {
          int selectedIndex = tabPane.getSelectedIndex();
  
          if (--selectedIndex < 0) {
              tabPane.setSelectedIndex(tabPane.getTabCount() == 0 ? -1 : 0);
          } else {
              tabPane.setSelectedIndex(selectedIndex);
          }
  
          tabPane.repaint();
      }
docs: Scroll the tab buttons backwards.