- incrDims.height, tabAreaRect.width,
- incrDims.height, incrDims.width,
    public void layoutContainer(Container pane)    {      super.layoutContainer(pane);      int tabCount = tabPane.getTabCount();      Point p = null;      if (tabCount == 0)        return;      int tabPlacement = tabPane.getTabPlacement();      incrButton.setVisible(false);      decrButton.setVisible(false);      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.setVisible(true);              decrButton.setVisible(true);            }        }      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.setVisible(true);              decrButton.setVisible(true);            }        }      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);          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(p);      viewport.repaint();    }