int end = (next != 0 ? next - 1 : tabCount - 1);
int end = next != 0 ? next - 1 : tabCount - 1;
  protected void paintTabArea(Graphics g, int tabPlacement, int selectedIndex)  {    Rectangle ir = new Rectangle();    Rectangle tr = new Rectangle();    boolean isScroll = tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT;    // Please note: the ordering of the painting is important.     // we WANT to paint the outermost run first and then work our way in.    int tabCount = tabPane.getTabCount();    for (int i = runCount - 1; i >= 0; --i)          {        int start = tabRuns[i];        int next;        if (i == runCount - 1)          next = tabRuns[0];        else          next = tabRuns[i + 1];        int end = (next != 0 ? next - 1 : tabCount - 1);        for (int j = start; j <= end; ++j)              {            if (j != selectedIndex)                  {                paintTab(g, tabPlacement, rects, j, ir, tr);                  }              }          }    // Paint selected tab in front of every other tab.    if (selectedIndex >= 0)      paintTab(g, tabPlacement, rects, selectedIndex, ir, tr);  }