public void mousePressed(MouseEvent e){
  int nclicks=SwingUtilities2.getAdjustedClickCount(getComponent(),e);
  if (SwingUtilities.isLeftMouseButton(e)) {
    if (e.isConsumed()) {
      shouldHandleRelease=true;
    }
 else {
      shouldHandleRelease=false;
      adjustCaretAndFocus(e);
      if (nclicks == 2 && SwingUtilities2.canEventAccessSystemClipboard(e)) {
        selectWord(e);
      }
    }
  }
}

public void mousePressed ( MouseEvent e ) { int nclicks = SwingUtilities2 . getAdjustedClickCount ( getComponent ( ) , e ) ; if ( SwingUtilities . isLeftMouseButton ( e ) ) { if ( e . isConsumed ( ) ) { shouldHandleRelease = true ; } else { shouldHandleRelease = false ; adjustCaretAndFocus ( e ) ; if ( nclicks == 2 && SwingUtilities2 . canEventAccessSystemClipboard ( e ) ) { selectWord ( e ) ; } } } }
if button 1 is pressed , this is implemented to request focus on the associated text component , and to set the caret position . if the shift key is held down , the caret will be moved , potentially resulting in a selection , otherwise the caret position will be set to the new location . if the component is not enabled , there will be no request for focus .
