
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import java.util.Vector;
import java.lang.*;

// Hat alle wichtige Listener im JFrame implementiert


public class Listener_Bsp01 extends JFrame {


  //Frame konstruieren
  public Listener_Bsp01() {
    this.setSize(new Dimension(500, 300));
    this.setTitle("JFrame mit Mouse-Listener10");
    setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
    setGUI();
  }


  //Initialisierung der Komponente
  private void setGUI()  {
    this.addWindowListener(new java.awt.event.WindowAdapter() {

      public void windowActivated(WindowEvent e) {
        this_windowActivated(e);
      }

      public void windowClosed(WindowEvent e) {
        this_windowClosed(e);
      }

      public void windowClosing(WindowEvent e) {
        this_windowClosing(e);
      }

      public void windowDeactivated(WindowEvent e) {
        this_windowDeactivated(e);
      }

      public void windowDeiconified(WindowEvent e) {
        this_windowDeiconified(e);
      }

      public void windowIconified(WindowEvent e) {
        this_windowIconified(e);
      }

      public void windowOpened(WindowEvent e) {
        this_windowOpened(e);
      }
    });
    this.addMouseMotionListener(new java.awt.event.MouseMotionAdapter() {

      public void mouseDragged(MouseEvent e) {
        this_mouseDragged(e);
      }

      public void mouseMoved(MouseEvent e) {
        this_mouseMoved(e);
      }
    });
    this.addMouseListener(new java.awt.event.MouseAdapter() {

      public void mouseClicked(MouseEvent e) {
        this_mouseClicked(e);
      }

      public void mouseEntered(MouseEvent e) {
        this_mouseEntered(e);
      }

      public void mouseExited(MouseEvent e) {
        this_mouseExited(e);
      }

      public void mousePressed(MouseEvent e) {
        this_mousePressed(e);
      }

      public void mouseReleased(MouseEvent e) {
        this_mouseReleased(e);
      }
    });
    this.addKeyListener(new java.awt.event.KeyAdapter() {

      public void keyPressed(KeyEvent e) {
        this_keyPressed(e);
      }

      public void keyReleased(KeyEvent e) {
        this_keyReleased(e);
      }

      public void keyTyped(KeyEvent e) {
        this_keyTyped(e);
      }
    });
    this.addFocusListener(new java.awt.event.FocusAdapter() {

      public void focusGained(FocusEvent e) {
        this_focusGained(e);
      }

      public void focusLost(FocusEvent e) {
        this_focusLost(e);
      }
    });

  }  // setGUI




  void this_focusGained(FocusEvent e) {
    System.out.println("focusGained, focus erhalten");
  }

  void this_focusLost(FocusEvent e) {
    System.out.println("focusLost");
  }

  void this_keyPressed(KeyEvent e) {
    System.out.println("keyPressed");
  }

  void this_keyReleased(KeyEvent e) {
    System.out.println("keyReleased");
  }

  void this_keyTyped(KeyEvent e) {
    System.out.println("keyTyped");
  }

  void this_mouseClicked(MouseEvent e) {
    System.out.println("mouseClicked");
  }

  void this_mouseDragged(MouseEvent e) {
    System.out.println("mouseDragged");
  }

  void this_mouseEntered(MouseEvent e) {
    System.out.println("mouseEntered");
  }

  void this_mouseExited(MouseEvent e) {
    System.out.println("mouseExited");
  }

  void this_mouseMoved(MouseEvent e) {
    System.out.println("mouseMoved");
  }

  void this_mousePressed(MouseEvent e) {
    System.out.println("mousePressed");
  }

  void this_mouseReleased(MouseEvent e) {
    System.out.println("mouseReleased");
  }

  void this_windowActivated(WindowEvent e) {
    System.out.println("windowActivated");
  }

  void this_windowClosed(WindowEvent e) {
    System.out.println("windowClosed");
  }

  void this_windowClosing(WindowEvent e) {
    System.out.println("windowClosing");
  }

  void this_windowDeactivated(WindowEvent e) {
    System.out.println("windowDeactivated");
  }

  void this_windowDeiconified(WindowEvent e) {
    System.out.println("windowDeiconified");
  }

  void this_windowIconified(WindowEvent e) {
    System.out.println("windowIconified");
  }

  void this_windowOpened(WindowEvent e) {
    System.out.println("windowOpened");
  }


  public static void main(String[] args) {
    Listener_Bsp01 frame = new Listener_Bsp01();
    frame.setVisible(true);
  }

}
