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 voidkeyPressed(java.awt.event.KeyEvent e)Checks if a key is pressed if it is ESC.voidkeyReleased(java.awt.event.KeyEvent e)Checks if a key is released if it is ESC.voidkeyTyped(java.awt.event.KeyEvent e)Checks if a key is typed if it is ESC.
-
Constructor Details
-
EscapeListener
public EscapeListener()
-
-
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:
keyReleasedin interfacejava.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:
keyTypedin interfacejava.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:
keyPressedin interfacejava.awt.event.KeyListener- Parameters:
e- the key event to be checked.
-