if (index >= 0 && tabPane.isEnabledAt(index))
if (!tabPane.isEnabledAt(index)) return;  if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT && s == panel) { scrollTab(index, placement);  tabPane.setSelectedIndex(index); tabPane.repaint(); } else
    public void mousePressed(MouseEvent e)    {      if (tabPane.isEnabled())        {          int index = tabForCoordinate(tabPane, e.getX(), e.getY());          if (index >= 0 && tabPane.isEnabledAt(index))            {              tabPane.setSelectedIndex(index);            }            }        }