Enum MouseEvent.Button

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<MouseEvent.Button>
    Enclosing class:
    MouseEvent

    public static enum MouseEvent.Button
    extends java.lang.Enum<MouseEvent.Button>
    Defines the mouse buttons that can be involved in a mouse event.
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      Button1
      The primary mouse button (usually the left button).
      Button2
      The middle mouse button.
      Button3
      The secondary mouse button (usually the right button).
      NoButton
      No specific button is involved (used for move events).
      WheelDown
      The mouse wheel was scrolled downward.
      WheelUp
      The mouse wheel was scrolled upward.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static MouseEvent.Button valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static MouseEvent.Button[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Enum Constant Detail

      • NoButton

        public static final MouseEvent.Button NoButton
        No specific button is involved (used for move events).
      • Button1

        public static final MouseEvent.Button Button1
        The primary mouse button (usually the left button).
      • Button3

        public static final MouseEvent.Button Button3
        The secondary mouse button (usually the right button).
      • WheelUp

        public static final MouseEvent.Button WheelUp
        The mouse wheel was scrolled upward.
      • WheelDown

        public static final MouseEvent.Button WheelDown
        The mouse wheel was scrolled downward.
    • Method Detail

      • values

        public static MouseEvent.Button[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MouseEvent.Button c : MouseEvent.Button.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MouseEvent.Button valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null