int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);
  protected void paintText(Graphics g, int tabPlacement, Font font,                           FontMetrics metrics, int tabIndex, String title,                           Rectangle textRect, boolean isSelected)  {    View textView = getTextViewForTab(tabIndex);    if (textView != null)      {        textView.paint(g, textRect);        return;      }    Color fg = tabPane.getForegroundAt(tabIndex);    if (fg == null)      fg = tabPane.getForeground();    Color bg = tabPane.getBackgroundAt(tabIndex);    if (bg == null)      bg = tabPane.getBackground();    Color saved_color = g.getColor();    Font f = g.getFont();    g.setFont(font);    if (tabPane.isEnabledAt(tabIndex))      {        g.setColor(fg);        int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);        if (mnemIndex != -1)          BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex,                                                       textRect.x,                                                       textRect.y                                                       + metrics.getAscent());        else          g.drawString(title, textRect.x, textRect.y + metrics.getAscent());      }    else      {        g.setColor(bg.brighter());        int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);        if (mnemIndex != -1)          BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex,                                                       textRect.x, textRect.y);        else          g.drawString(title, textRect.x, textRect.y);        g.setColor(bg.darker());        if (mnemIndex != -1)          BasicGraphicsUtils.drawStringUnderlineCharAt(g, title, mnemIndex,                                                       textRect.x + 1,                                                       textRect.y + 1);        else          g.drawString(title, textRect.x + 1, textRect.y + 1);      }    g.setColor(saved_color);    g.setFont(f);  }