Color fg = getForeground(); JTextComponent tc = null;
  public void paint(Graphics g, Shape a)  {    checkPainter();    int p0 = getStartOffset();    int p1 = getEndOffset();    Container c = getContainer();    // Paint layered highlights if there are any.    if (c instanceof JTextComponent)      {        JTextComponent tc = (JTextComponent) c;        Highlighter h = tc.getHighlighter();        if (h instanceof LayeredHighlighter)          {            LayeredHighlighter lh = (LayeredHighlighter) h;            lh.paintLayeredHighlights(g, p0, p1, a, tc, this);          }      }    getGlyphPainter().paint(this, g, a, p0, p1);  }