tabPane.layout();
tabPane.revalidate();
    public void mousePressed(MouseEvent e)    {      int x = e.getX();      int y = e.getY();      int tabCount = tabPane.getTabCount();      if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)        {	  if (e.getSource() == incrButton)	    {	      if (++currentScrollLocation >= tabCount)		currentScrollLocation = tabCount - 1;	      if (currentScrollLocation == tabCount - 1)		incrButton.setEnabled(false);	      else if (! decrButton.isEnabled())		decrButton.setEnabled(true);	      tabPane.layout();	      tabPane.repaint();	      return;	    }	  else if (e.getSource() == decrButton)	    {	      if (--currentScrollLocation < 0)		currentScrollLocation = 0;	      if (currentScrollLocation == 0)		decrButton.setEnabled(false);	      else if (! incrButton.isEnabled())		incrButton.setEnabled(true);	      tabPane.layout();	      tabPane.repaint();	      return;	    }        }      int index = tabForCoordinate(tabPane, x, y);      // We need to check since there are areas where tabs cannot be      // e.g. in the inset area.      if (index != -1 && tabPane.isEnabledAt(index))	tabPane.setSelectedIndex(index);      tabPane.layout();      tabPane.repaint();    }