Example usage for java.awt.event FocusEvent FocusEvent

List of usage examples for java.awt.event FocusEvent FocusEvent

Introduction

In this page you can find the example usage for java.awt.event FocusEvent FocusEvent.

Prototype

public FocusEvent(Component source, int id, boolean temporary, Component opposite) 

Source Link

Document

Constructs a FocusEvent object with the specified temporary state, opposite Component and the Cause.UNKNOWN cause.

Usage

From source file:com.github.fritaly.dualcommander.TabbedPane.java

@Override
public void focusGained(FocusEvent e) {
    // Propagate the event
    final FocusListener[] listeners = getListeners(FocusListener.class);

    if (listeners != null) {
        final FocusEvent event = new FocusEvent(this, e.getID(), e.isTemporary(), e.getOppositeComponent());

        for (FocusListener listener : listeners) {
            listener.focusGained(event);
        }//from  w ww . j av  a  2  s  .  c o  m
    }
}

From source file:com.github.fritaly.dualcommander.TabbedPane.java

@Override
public void focusLost(FocusEvent e) {
    // Propagate the event
    final FocusListener[] listeners = getListeners(FocusListener.class);

    if (listeners != null) {
        final FocusEvent event = new FocusEvent(this, e.getID(), e.isTemporary(), e.getOppositeComponent());

        for (FocusListener listener : listeners) {
            listener.focusLost(event);//from   w  w w.  j a v a  2 s  .  co  m
        }
    }
}

From source file:com.github.fritaly.dualcommander.DirectoryBrowser.java

@Override
public void focusGained(FocusEvent e) {
    if (e.getSource() == table) {
        // Propagate the event
        final FocusListener[] listeners = getListeners(FocusListener.class);

        if (listeners != null) {
            final FocusEvent event = new FocusEvent(this, e.getID(), e.isTemporary(), e.getOppositeComponent());

            for (FocusListener listener : listeners) {
                listener.focusGained(event);
            }/*  w ww .  j  a v a2  s .co  m*/
        }
    }
}

From source file:com.github.fritaly.dualcommander.DirectoryBrowser.java

@Override
public void focusLost(FocusEvent e) {
    if (e.getSource() == table) {
        // Propagate the event
        final FocusListener[] listeners = getListeners(FocusListener.class);

        if (listeners != null) {
            final FocusEvent event = new FocusEvent(this, e.getID(), e.isTemporary(), e.getOppositeComponent());

            for (FocusListener listener : listeners) {
                listener.focusLost(event);
            }/* w w w.  jav  a 2  s. c  o  m*/
        }
    }
}