Package Controller

Class EscapeListener

java.lang.Object
Controller.EscapeListener
All Implemented Interfaces:
java.awt.event.KeyListener, java.util.EventListener

public class EscapeListener
extends java.lang.Object
implements java.awt.event.KeyListener
This Class is a listener that checks every interaction with every component after the hit of a ESC button. If ESC is hit it closes down the program.
  • Constructor Summary

    Constructors 
    Constructor Description
    EscapeListener()  
  • Method Summary

    Modifier and Type Method Description
    void keyPressed​(java.awt.event.KeyEvent e)
    Checks if a key is pressed if it is ESC.
    void keyReleased​(java.awt.event.KeyEvent e)
    Checks if a key is released if it is ESC.
    void keyTyped​(java.awt.event.KeyEvent e)
    Checks if a key is typed if it is ESC.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

  • Method Details

    • keyReleased

      public void keyReleased​(java.awt.event.KeyEvent e)
      Checks if a key is released if it is ESC. In that case it shuts off the program.
      Specified by:
      keyReleased in interface java.awt.event.KeyListener
      Parameters:
      e - the key event to be checked.
    • keyTyped

      public void keyTyped​(java.awt.event.KeyEvent e)
      Checks if a key is typed if it is ESC. In that case it shuts off the program.
      Specified by:
      keyTyped in interface java.awt.event.KeyListener
      Parameters:
      e - the key event to be checked.
    • keyPressed

      public void keyPressed​(java.awt.event.KeyEvent e)
      Checks if a key is pressed if it is ESC. In that case it shuts off the program.
      Specified by:
      keyPressed in interface java.awt.event.KeyListener
      Parameters:
      e - the key event to be checked.