public static boolean isRightMouseButton(MouseEvent anEvent){
  return ((anEvent.getModifiersEx() & InputEvent.BUTTON3_DOWN_MASK) != 0 || anEvent.getButton() == MouseEvent.BUTTON3);
}

public static boolean isRightMouseButton ( MouseEvent anEvent ) { return ( ( anEvent . getModifiersEx ( ) & InputEvent . BUTTON3_DOWN_MASK ) != 0 || anEvent . getButton ( ) == MouseEvent . BUTTON3 ) ; }
returns true if the mouse event specifies the right mouse button .
