background = UIManager.getColor(prefix + ".background"); inactiveBackground = UIManager.getColor(prefix + ".inactiveBackground"); textComponent.setDisabledTextColor (UIManager.getColor(prefix + ".inactiveForeground")); textComponent.setSelectedTextColor(UIManager.getColor(prefix + ".selectionForeground")); textComponent.setSelectionColor(UIManager.getColor(prefix + ".selectionBackground"));
color = textComponent.getDisabledTextColor(); if (color == null || color instanceof UIResource) { color = UIManager.getColor(prefix + ".inactiveBackground"); textComponent.setDisabledTextColor(color); } color = textComponent.getSelectedTextColor(); if (color == null || color instanceof UIResource) { color = UIManager.getColor(prefix  + ".selectionForeground"); textComponent.setSelectedTextColor(color); } color = textComponent.getSelectionColor(); if (color == null || color instanceof UIResource) { color = UIManager.getColor(prefix  + ".selectionBackground"); textComponent.setSelectionColor(color); }  Insets margin = textComponent.getMargin(); if (margin == null || margin instanceof UIResource) { margin = UIManager.getInsets(prefix + ".margin"); textComponent.setMargin(margin); }  Caret caret = textComponent.getCaret(); if (caret == null || caret instanceof UIResource) { caret = createCaret(); textComponent.setCaret(caret); caret.setBlinkRate(UIManager.getInt(prefix + ".caretBlinkRate")); }  Highlighter highlighter = textComponent.getHighlighter(); if (highlighter == null || highlighter instanceof UIResource) textComponent.setHighlighter(createHighlighter());
  protected void installDefaults()  {    Caret caret = textComponent.getCaret();    if (caret == null)      {        caret = createCaret();        textComponent.setCaret(caret);      }    Highlighter highlighter = textComponent.getHighlighter();    if (highlighter == null)      textComponent.setHighlighter(createHighlighter());    String prefix = getPropertyPrefix();    LookAndFeel.installColorsAndFont(textComponent, prefix + ".background",                                     prefix + ".foreground", prefix + ".font");    LookAndFeel.installBorder(textComponent, prefix + ".border");    textComponent.setMargin(UIManager.getInsets(prefix + ".margin"));    caret.setBlinkRate(UIManager.getInt(prefix + ".caretBlinkRate"));    // Fetch the colors for enabled/disabled text components.    background = UIManager.getColor(prefix + ".background");    inactiveBackground = UIManager.getColor(prefix + ".inactiveBackground");    textComponent.setDisabledTextColor                         (UIManager.getColor(prefix + ".inactiveForeground"));    textComponent.setSelectedTextColor(UIManager.getColor(prefix + ".selectionForeground"));    textComponent.setSelectionColor(UIManager.getColor(prefix + ".selectionBackground"));      }