Class MouseEvent


  • public class MouseEvent
    extends Event
    • Constructor Detail

      • MouseEvent

        public MouseEvent​(Object nativeObject,
                          long millis,
                          int action,
                          int modifiers,
                          int x,
                          int y,
                          int button,
                          int count)
    • Method Detail

      • getX

        public int getX()
      • getY

        public int getY()
      • getButton

        public int getButton()
        Which button was pressed, either LEFT, CENTER, or RIGHT.
      • getClickCount

        @Deprecated
        public int getClickCount()
        Deprecated.
        Do not use, getCount() is the correct method.
      • getAmount

        @Deprecated
        public float getAmount()
        Deprecated.
        Do not use, getCount() is the correct method.
      • getCount

        public int getCount()
        Number of clicks for mouse button events, or the number of steps (positive or negative depending on direction) for a mouse wheel event. Wheel events follow Java (see here), so getAmount() will return "negative values if the mouse wheel was rotated up or away from the user" and positive values in the other direction. On Mac OS X, this will be reversed when "natural" scrolling is enabled in System Preferences &rarr Mouse.