this.dot = dot;
Document doc = textComponent.getDocument(); if (doc != null) this.dot = Math.min(dot, doc.getLength()); this.dot = Math.max(this.dot, 0);
  public void moveDot(int dot)  {    if (dot >= 0)      {    this.dot = dot;    handleHighlight();    adjustVisibility(this);        appear();      }  }