public static boolean isMiddleMouseButton(MouseEvent anEvent){
  return ((anEvent.getModifiersEx() & InputEvent.BUTTON2_DOWN_MASK) != 0 || anEvent.getButton() == MouseEvent.BUTTON2);
}

public static boolean isMiddleMouseButton ( MouseEvent anEvent ) { return ( ( anEvent . getModifiersEx ( ) & InputEvent . BUTTON2_DOWN_MASK ) != 0 || anEvent . getButton ( ) == MouseEvent . BUTTON2 ) ; }
returns true if the mouse event specifies the middle mouse button .
