if (pane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { Rectangle r = new Rectangle(rects[i]);  switch(pane.getTabPlacement()) { case SwingConstants.TOP: case SwingConstants.BOTTOM: r.x -= currentScrollOffset; break; default: r.y -= currentScrollOffset; }  return r; }
  public Rectangle getTabBounds(JTabbedPane pane, int i)  {    // Need to re-layout container if tab does not exist.    if (i >= rects.length)      layoutManager.layoutContainer(pane);    return rects[i];  }