{ if (c.isEnabled())
{ JTextComponent tc = (JTextComponent) c; if (tc.isEnabled() && tc.isEditable())
    public void paintBorder(Component c, Graphics g, int x, int y, int w,         int h)    {              if (c.isEnabled())        super.paintBorder(c, g, x, y, w, h);      else        {          Color savedColor = g.getColor();          g.setColor(MetalLookAndFeel.getControlShadow());          g.drawRect(x, y, w - 1, h - 1);          g.setColor(savedColor);        }    }