code: private void handleMatch(Point match)
      {
          if (match == null)
          {
              int caretPosition = textComponent.getCaretPosition();
              Document document = textComponent.getDocument();
              caretPosition = Math.max(0, Math.min(
                  document.getLength(), caretPosition));
              textComponent.setCaretPosition(caretPosition);
              textComponent.moveCaretPosition(caretPosition);
              textComponent.getCaret().setSelectionVisible(false);
          }
          else
          {
              textComponent.setCaretPosition(match.y);
              textComponent.moveCaretPosition(match.x);
              textComponent.getCaret().setSelectionVisible(true);
          }
      }
docs: Handle a match described by the given point. If the given point is
  <code>null</code>, then the current selection will be cleared.
  Otherwise, the range denoted by the point will be selected
  
  @param match The match