else if(button == MouseEvent.BUTTON2) if (event.isShiftDown()) event.consume(); else { positionCaret(event); textComponent.paste(); } else event.consume();
  public void mousePressed(MouseEvent event)  {    if (event.isShiftDown())      moveCaret(event);    else    positionCaret(event);  }