<<< Registering event sources and handlers, cont. | Index | KeyEvent class >>> |
The KeyListener interface receives actions that user initiates from the keyboard
Declares three methods:
keyPressed() // character typed -- no calls from function keys keyTyped() // function keys and keys not generating any characters keyReleased() // used in most cases, including function keys
The keyReleased() does not take action while user holds down key
The keyTyped() is platform independent -- preferred way of handling the keyboard.
The keyPressed() and keyReleased() are platform/locale dependent.
<<< Registering event sources and handlers, cont. | Index | KeyEvent class >>> |