Point p = findPointForIndex(currentScrollLocation);
p = findPointForIndex(currentScrollLocation);
    public void layoutContainer(Container pane)    {      super.layoutContainer(pane);      int tabCount = tabPane.getTabCount();      if (tabCount == 0)	return;      int tabPlacement = tabPane.getTabPlacement();      incrButton.hide();      decrButton.hide();      if (tabPlacement == SwingConstants.TOP          || tabPlacement == SwingConstants.BOTTOM)        {	  if (tabAreaRect.x + tabAreaRect.width < rects[tabCount - 1].x	      + rects[tabCount - 1].width)	    {	      Dimension incrDims = incrButton.getPreferredSize();	      Dimension decrDims = decrButton.getPreferredSize();	      decrButton.setBounds(tabAreaRect.x + tabAreaRect.width	                           - incrDims.width - decrDims.width,	                           tabAreaRect.y, decrDims.width,	                           tabAreaRect.height);	      incrButton.setBounds(tabAreaRect.x + tabAreaRect.width	                           - incrDims.width, tabAreaRect.y,	                           decrDims.width, tabAreaRect.height);	      tabAreaRect.width -= decrDims.width + incrDims.width;	      incrButton.show();	      decrButton.show();	    }        }      if (tabPlacement == SwingConstants.LEFT          || tabPlacement == SwingConstants.RIGHT)        {	  if (tabAreaRect.y + tabAreaRect.height < rects[tabCount - 1].y	      + rects[tabCount - 1].height)	    {	      Dimension incrDims = incrButton.getPreferredSize();	      Dimension decrDims = decrButton.getPreferredSize();	      decrButton.setBounds(tabAreaRect.x,	                           tabAreaRect.y + tabAreaRect.height	                           - incrDims.height - decrDims.height,	                           tabAreaRect.width, decrDims.height);	      incrButton.setBounds(tabAreaRect.x,	                           tabAreaRect.y + tabAreaRect.height	                           - incrDims.height, tabAreaRect.width,	                           incrDims.height);	      tabAreaRect.height -= decrDims.height + incrDims.height;	      incrButton.show();	      decrButton.show();	    }        }      viewport.setBounds(tabAreaRect.x, tabAreaRect.y, tabAreaRect.width,                         tabAreaRect.height);      int tabC = tabPane.getTabCount() - 1;      if (tabCount > 0)        {	  int w = Math.max(rects[tabC].width + rects[tabC].x, tabAreaRect.width);	  int h = Math.max(rects[tabC].height, tabAreaRect.height);	  Point p = findPointForIndex(currentScrollLocation);	  // we want to cover that entire space so that borders that run under	  // the tab area don't show up when we move the viewport around.	  panel.setSize(w + p.x, h + p.y);        }      viewport.setViewPosition(findPointForIndex(currentScrollLocation));    }