public static boolean isButtonPressed(InputEvent e,int button){
  return (e.getModifiers() & button) == button;
}

public static boolean isButtonPressed ( InputEvent e , int button ) { return ( e . getModifiers ( ) & button ) == button ; }
indicates if a given mouse button is being pressed .
