private void updateBackground(JTextComponent c){
  if (this instanceof SynthUI || (c instanceof JTextArea)) {
    return;
  }
  Color background=c.getBackground();
  if (background instanceof UIResource) {
    String prefix=getPropertyPrefix();
    Color disabledBG=DefaultLookup.getColor(c,this,prefix + ".disabledBackground",null);
    Color inactiveBG=DefaultLookup.getColor(c,this,prefix + ".inactiveBackground",null);
    Color bg=DefaultLookup.getColor(c,this,prefix + ".background",null);
    if ((c instanceof JTextArea || c instanceof JEditorPane) && background != disabledBG && background != inactiveBG && background != bg) {
      return;
    }
    Color newColor=null;
    if (!c.isEnabled()) {
      newColor=disabledBG;
    }
    if (newColor == null && !c.isEditable()) {
      newColor=inactiveBG;
    }
    if (newColor == null) {
      newColor=bg;
    }
    if (newColor != null && newColor != background) {
      c.setBackground(newColor);
    }
  }
}

private void updateBackground ( JTextComponent c ) { if ( this instanceof SynthUI || ( c instanceof JTextArea ) ) { return ; } Color background = c . getBackground ( ) ; if ( background instanceof UIResource ) { String prefix = getPropertyPrefix ( ) ; Color disabledBG = DefaultLookup . getColor ( c , this , prefix + ".disabledBackground" , null ) ; Color inactiveBG = DefaultLookup . getColor ( c , this , prefix + ".inactiveBackground" , null ) ; Color bg = DefaultLookup . getColor ( c , this , prefix + ".background" , null ) ; if ( ( c instanceof JTextArea || c instanceof JEditorPane ) && background != disabledBG && background != inactiveBG && background != bg ) { return ; } Color newColor = null ; if ( ! c . isEnabled ( ) ) { newColor = disabledBG ; } if ( newColor == null && ! c . isEditable ( ) ) { newColor = inactiveBG ; } if ( newColor == null ) { newColor = bg ; } if ( newColor != null && newColor != background ) { c . setBackground ( newColor ) ; } } }
updates the background of the text component based on whether the text component is editable and / or enabled .
