AWT Event Listeners- AWT TextListener Interface - AWT (Abstract Window Toolkit)

What is the use of AWT TextListener Interface?

Class which processes the TextEvent will implement this interface and the object of that class will be registered with a component. The object can be registered using the addTextListener() method.

Interface declaration

Below is the declaration for java.awt.event.TextListener interface:

Interface methods


Method & Description


void textValueChanged(TextEvent e)

Invoked when the value of the text has changed.

Methods inherited

This interface inherits methods from the following interfaces:

  • java.awt.EventListener

TextListener Example

Create the following java program using any editor of your choice in say D:/ > AWT > com > wisdomjobs > gui >

Compile the program using command prompt. Go to D:/ > AWT and type the following command.

If no error comes that means compilation is successful. Run the program using following command.

Verify the following output


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

AWT (Abstract Window Toolkit) Topics