Package codedraw

Class MouseClickEvent

java.lang.Object
codedraw.Event
codedraw.MouseClickEvent

public class MouseClickEvent extends Event
This argument is given once every time a mouse button is pressed down and quickly released again.
  • Method Details

    • getX

      public int getX()
      Gets the distance in pixel from the left side of the canvas to the mouse.
      Returns:
      the distance in pixel.
    • getY

      public int getY()
      Gets the distance in pixel from the top side of the canvas to the mouse.
      Returns:
      the distance in pixel.
    • getMouseButton

      public MouseButton getMouseButton()
      Gets the type of mouse button that was pressed to trigger the event.
      Returns:
      a mouse button.
    • toString

      public String toString()
      Overrides:
      toString in class Object