int count = event.getClickCount();  if (count >= 2) { int newDot = getComponent().viewToModel(event.getPoint()); JTextComponent t = getComponent();  try { if (count == 3) t.select(Utilities.getRowStart(t, newDot), Utilities.getRowEnd(t, newDot)); else { int nextWord = Utilities.getNextWord(t, newDot);      if (newDot == nextWord) t.select(nextWord, Utilities.getNextWord(t, nextWord)); else { int previousWord = Utilities.getPreviousWord(t, newDot); int previousWordEnd = Utilities.getWordEnd(t, previousWord);    if (newDot >= previousWordEnd && newDot <= nextWord) t.select(previousWordEnd, nextWord);  else t.select(previousWord, previousWordEnd); } } } catch(BadLocationException ble) {  }  dot = newDot; }
  public void mouseClicked(MouseEvent event)  {    // TODO: Implement double- and triple-click behaviour here.  }