if (componentWithSelection == textComponent) componentWithSelection = null;
  private void clearHighlight()  {    Highlighter highlighter = textComponent.getHighlighter();        if (highlighter == null)      return;        if (selectionVisible)      {    try      {        if (highlightEntry == null)          highlightEntry = highlighter.addHighlight(0, 0, getSelectionPainter());        else          highlighter.changeHighlight(highlightEntry, 0, 0);      }    catch (BadLocationException e)      {        // This should never happen.        throw new InternalError();      }      }    else      {    if (highlightEntry != null)      {        highlighter.removeHighlight(highlightEntry);        highlightEntry = null;      }      }  }