Class MouseUpEvent


public class MouseUpEvent extends MouseEvent
Represents a mouse button release (up) event that occurs when a user releases a pressed mouse button.

This event is fired when the user releases a mouse button that was previously pressed while over an element. It extends MouseEvent to inherit coordinate tracking capabilities and is dispatched to registered MouseListener instances for processing. This event completes the mouse interaction lifecycle that begins with MouseDownEvent.

Features:

  • Captures mouse button release with client coordinates
  • Inherits X and Y coordinate tracking from MouseEvent
  • Part of the mouse interaction lifecycle (down, move, up)
  • Integrates with the mouse event listener pattern

Usage:


 // Create a mouse up event at coordinates (180, 220)
 MouseUpEvent event = new MouseUpEvent(180, 220);

 // Access inherited coordinate getters
 int x = event.getClientX(); // Returns 180
 int y = event.getClientY(); // Returns 220

 // Dispatch to a listener
 event.dispatchTo(myMouseListener);
 
Since:
2016
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • MouseUpEvent

      public MouseUpEvent(int clientX, int clientY)
      Constructs a new MouseUpEvent with the specified client coordinates.
      Parameters:
      clientX - the X coordinate of the mouse pointer relative to the client viewport
      clientY - the Y coordinate of the mouse pointer relative to the client viewport
  • Method Details

    • dispatchTo

      public void dispatchTo(MouseClickListener listener)
      Dispatches this event to the specified listener for processing.

      This method invokes the listener's onEvent method with this event instance, allowing the listener to handle the mouse button release event.

      Specified by:
      dispatchTo in class Event<MouseClickListener>
      Parameters:
      listener - the listener to which this event should be dispatched