public class

CausedFocusEvent

extends FocusEvent
java.lang.Object
   ↳ java.util.EventObject
     ↳ java.awt.AWTEvent
       ↳ java.awt.event.ComponentEvent
         ↳ java.awt.event.FocusEvent
           ↳ sun.awt.CausedFocusEvent

Class Overview

This class represents FocusEvents with a known "cause" - reason why this event happened. It can be mouse press, traversal, activation, and so on - all causes are described as Cause enum. The event with the cause can be constructed in two ways - explicitly through constructor of CausedFocusEvent class or implicitly, by calling appropriate requestFocusXXX method with "cause" parameter. The default cause is UNKNOWN.

Summary

Nested Classes
enum CausedFocusEvent.Cause  
[Expand]
Inherited Constants
From class java.awt.event.FocusEvent
From class java.awt.event.ComponentEvent
From class java.awt.AWTEvent
[Expand]
Inherited Fields
From class java.awt.AWTEvent
From class java.util.EventObject
Public Constructors
CausedFocusEvent(Component source, int id, boolean temporary, Component opposite, CausedFocusEvent.Cause cause)
Public Methods
CausedFocusEvent.Cause getCause()
static FocusEvent retarget(FocusEvent e, Component newSource)
Retargets the original focus event to the new target.
String toString()
Returns a String representation of this object.
[Expand]
Inherited Methods
From class java.awt.event.FocusEvent
From class java.awt.event.ComponentEvent
From class java.awt.AWTEvent
From class java.util.EventObject
From class java.lang.Object

Public Constructors

public CausedFocusEvent (Component source, int id, boolean temporary, Component opposite, CausedFocusEvent.Cause cause)

Public Methods

public CausedFocusEvent.Cause getCause ()

public static FocusEvent retarget (FocusEvent e, Component newSource)

Retargets the original focus event to the new target. If the original focus event is CausedFocusEvent, it remains such and cause is copied. Otherwise, new CausedFocusEvent is created, with cause as RETARGETED.

Returns
  • retargeted event, or null if e is null

public String toString ()

Returns a String representation of this object.

Returns
  • A a String representation of this EventObject.