Class MouseOutEvent


public class MouseOutEvent extends MouseEvent
Represents a mouse exit event that occurs when the mouse pointer leaves an element's boundaries.

This event is fired when the mouse pointer moves from inside an element to outside its boundaries. It extends MouseEvent to inherit coordinate tracking capabilities and is dispatched to registered MouseListener instances for processing. This event is commonly used to implement hover effects or to trigger actions when the user's mouse leaves an interactive area.

Features:

  • Detects when mouse pointer exits an element
  • Inherits X and Y coordinate tracking from MouseEvent
  • Complements MouseOverEvent for enter/exit tracking
  • Integrates with the mouse event listener pattern

Usage:


 // Create a mouse out event at coordinates (100, 150)
 MouseOutEvent event = new MouseOutEvent(100, 150);

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

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

    • MouseOutEvent

      public MouseOutEvent(int clientX, int clientY)
      Constructs a new MouseOutEvent 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 exit event.

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