JTextComponent tc = (JTextComponent) c;
tc = (JTextComponent) c; if (! tc.isEnabled()) fg = tc.getDisabledTextColor(); } Color bg = getBackground(); if (bg != null) { g.setColor(bg); System.err.println("fill background: " + bg); g.fillRect(r.x, r.y, r.width, r.height); }    if (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);  }