[Chapter 20] 20.17 java.awt.event.KeyAdapter (JDK 1.1)
Author: David Flanagan
Date: Thu Jul 31 16:14:03 1997

#

| Chapter 20 The java.awt.event Package |

## 20.17 java.awt.event.KeyAdapter (JDK 1.1)

###

This class is a trivial implementation of `KeyListener`; it provides empty bodies for each of the methods of that interface. When you are not interested in all of these methods, it is often easier to subclass `KeyAdapter` than it is to implement `KeyListener` from scratch.

    public abstract class KeyAdapter extends Object implements KeyListener {
        // Default Constructor: public KeyAdapter()
        // Public Instance Methods
                public void keyPressed(KeyEvent e);  // From KeyListener
                public void keyReleased(KeyEvent e);  // From KeyListener
                public void keyTyped(KeyEvent e);  // From KeyListener
    }

### Hierarchy:

`Object->KeyAdapter(KeyListener(EventListener))`

java.awt.event.ItemListener (JDK 1.1) |  | java.awt.event.KeyEvent (JDK 1.1)