height = getComponent().getHeight();
try { height = textComponent.modelToView(dot).height; } catch (BadLocationException ble) {  throw new InternalError("Caret location not within document range."); }
  protected void damage(Rectangle r)  {    if (r == null)      return;    x = r.x;    y = r.y;    width = 1;    // height is normally set in paint and we leave it untouched. However, we    // must set a valid value here, since otherwise the painting mechanism    // sets a zero clip and never calls paint.    if (height <= 0)      height = getComponent().getHeight();    repaint();  }