Javatpoint Logo
Javatpoint Logo

Java KeyListener Interface

The Java KeyListener is notified whenever you change the state of key. It is notified against KeyEvent. The KeyListener interface is found in java.awt.event package. It has three methods.

Methods of KeyListener interface

The signature of 3 methods found in KeyListener interface are given below:

Java KeyListener Example

Output:

java awt keylistener example 1

Java KeyListener Example 2: Count Words & Characters

Output:

java awt keylistener example 2



Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA