Example usage for java.awt.event FocusAdapter subclass-usage

List of usage examples for java.awt.event FocusAdapter subclass-usage

Introduction

In this page you can find the example usage for java.awt.event FocusAdapter subclass-usage.

Usage

From source file Main.java

class MyFocusListener extends FocusAdapter {
    public void focusGained(FocusEvent evt) {
        System.out.println("gained the focus.");
    }

    public void focusLost(FocusEvent evt) {

From source file Main.java

class MyFocusListener extends FocusAdapter {
    public void focusGained(FocusEvent evt) {
        System.out.println("component gained the focus");
    }

    public void focusLost(FocusEvent evt) {

From source file Main.java

class MyFocusListener extends FocusAdapter {
    public void focusGained(FocusEvent evt) {

        Component c = evt.getOppositeComponent();
        System.out.println(c.getName());
    }

From source file Main.java

class MyFocusListener extends FocusAdapter {
    boolean showingDialog = false;

    public void focusGained(FocusEvent evt) {
        final JTextComponent c = (JTextComponent) evt.getSource();
        String s = c.getText();