Caret caret = textComponent.getCaret(); if (caret == null) { caret = createCaret(); textComponent.setCaret(caret); }  Highlighter highlighter = textComponent.getHighlighter(); if (highlighter == null) 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"));      }