Class FocusEvent

Direct Known Subclasses:
FocusInEvent, FocusOutEvent

public abstract class FocusEvent extends ClientEvent<FocusListener>
Abstract base class for focus-related client events.

This class serves as the parent for all focus events that occur when HTML elements receive or lose keyboard focus. Focus events are critical for tracking user navigation through form fields and interactive elements, enabling validation, UI updates, and accessibility features.

Features:

  • Base class for focus-in and focus-out events
  • Integrates with the FocusListener interface
  • Inherits source/target element tracking from ClientEvent
  • Supports focus-based UI interaction patterns

Usage: This class is not instantiated directly. Instead, use its concrete subclasses FocusInEvent and FocusOutEvent to represent specific focus state changes.


 // Handled through FocusListener implementations
 public void onEvent(FocusInEvent event) {
     Element source = event.getSource();
     // Element received focus
 }
 
Since:
2007
Version:
1.0
Author:
Marvin P. Warble Jr.
See Also:
  • Constructor Details

    • FocusEvent

      protected FocusEvent()
      Constructs a new FocusEvent.

      Protected constructor to ensure that only subclasses can instantiate focus events. This maintains proper event type hierarchy.