int startgap = rects[selectedIndex].y; int endgap = rects[selectedIndex].y + rects[selectedIndex].height;
int startgap = rects[selectedIndex].y - currentScrollOffset; int endgap = rects[selectedIndex].y + rects[selectedIndex].height - currentScrollOffset;
  protected void paintContentBorderRightEdge(Graphics g, int tabPlacement,                                             int selectedIndex, int x, int y,                                             int w, int h)  {    Color saved = g.getColor();    int startgap = rects[selectedIndex].y;    int endgap = rects[selectedIndex].y + rects[selectedIndex].height;    int diff = 0;    if (tabPlacement == SwingConstants.RIGHT)      {        if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT)          {            Point p = findPointForIndex(currentScrollLocation);            diff = p.y;          }        g.setColor(shadow);        g.drawLine(x + w - 1, y + 1, x + w - 1, startgap - diff);        g.drawLine(x + w - 1, endgap - diff, x + w - 1, y + h - 1);        g.setColor(darkShadow);        g.drawLine(x + w, y, x + w, startgap - diff);        g.drawLine(x + w, endgap - diff, x + w, y + h);      }    else      {        g.setColor(shadow);        g.drawLine(x + w - 1, y + 1, x + w - 1, y + h - 1);        g.setColor(darkShadow);        g.drawLine(x + w, y, x + w, y + h);      }    g.setColor(saved);  }