public void mousePressed(final MouseEvent mouseEvent){
  Point lastClickedPoint=mouseEvent.getPoint();
  if (mouseEvent.isControlDown() || (mouseEvent.getButton() == MouseEvent.BUTTON3)) {
    contextMenu.show(frame,(int)lastClickedPoint.getX() + MENU_X_OFFSET,(int)lastClickedPoint.getY() + MENU_Y_OFFSET);
  }
}

public void mousePressed ( final MouseEvent mouseEvent ) { Point lastClickedPoint = mouseEvent . getPoint ( ) ; if ( mouseEvent . isControlDown ( ) || ( mouseEvent . getButton ( ) == MouseEvent . BUTTON3 ) ) { contextMenu . show ( frame , ( int ) lastClickedPoint . getX ( ) + MENU_X_OFFSET , ( int ) lastClickedPoint . getY ( ) + MENU_Y_OFFSET ) ; } }
responds to mouse events .
