Example usage for java.awt AWTEvent FOCUS_EVENT_MASK

List of usage examples for java.awt AWTEvent FOCUS_EVENT_MASK

Introduction

In this page you can find the example usage for java.awt AWTEvent FOCUS_EVENT_MASK.

Prototype

long FOCUS_EVENT_MASK

To view the source code for java.awt AWTEvent FOCUS_EVENT_MASK.

Click Source Link

Document

The event mask for selecting focus events.

Usage

From source file:Main.java

/** The constructor: register the event types we are interested in */
public Main() {/*w  w  w.j  a  v  a 2 s.  c  om*/
    // We're interested in all types of events
    this.enableEvents(AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.KEY_EVENT_MASK
            | AWTEvent.FOCUS_EVENT_MASK | AWTEvent.COMPONENT_EVENT_MASK | AWTEvent.WINDOW_EVENT_MASK);
    this.setPreferredSize(new Dimension(500, 400));
}

From source file:EventTestPane.java

/** The constructor: register the event types we are interested in */
public EventTestPane() {
    // We're interested in all types of events
    this.enableEvents(AWTEvent.MOUSE_EVENT_MASK | AWTEvent.MOUSE_MOTION_EVENT_MASK | AWTEvent.KEY_EVENT_MASK
            | AWTEvent.FOCUS_EVENT_MASK | AWTEvent.COMPONENT_EVENT_MASK | AWTEvent.WINDOW_EVENT_MASK);
    this.setPreferredSize(new Dimension(500, 400));
}