Event Handling

Prev Tutorial Next Tutorial

Event Handling in AWT

In general you can not perform any operation on dummy GUI screen even any button click or select any item. To perform some operation on these dummy GUI screen you need some predefined classes and interfaces. All these type of classes and interfaces are available in java.awt.event package.

Changing the state of an object is known as an event.

The process of handling the request in GUI screen is known as event handling (event represent an action). It will be changes component to component.

Note: In event handling mechanism event represent an action class and Listener represent an interface. Listener interface always contains abstract methods so here you need to write your own logic.

Event classes and Listener interfaces

Event ClassesListener Interfaces
MouseEventMouseListener and MouseMotionListener

Steps to perform Event Handling

Following steps are required to perform event handling:

  • Implement the Listener interface and overrides its methods
  • Register the component with the Listener

Prev Tutorial Next Tutorial

Google Advertisements
Download Projects

Google Adsense Advertisements

Buy 3 Year Old Domain, Tutorialday.com, SeosmoTools.com @$200

Buy This Ad Space @$50 per Month, Ad Size 300X250 Contact on: hitesh.xc@gmail.com WhatsApp no. 8882538826

Yahoo Advertisements