Java WindowListener
Java WindowListener is a interface used for handling events related to window actions. Events like opening , closing, minimizing, etc are handled using WindowListener.
Syntax of WindowListener
public interface WindowListener extends EventListener
There are seven methods associated with WindowListener as mentioned below:
1. windowActivated (WindowEvent e):
Responds when window is first opened2. windowClosed (WindowEvent e):
Responds when the user attempts to close the window3. windowClosing (WindowEvent e):
Responds after a window has been closed4. windowDeactivated (WindowEvent e):
Responds when a window is minimized5. windowDeiconified (WindowEvent e):
Responds when a window is restored from a minimized state6. windowIconified (WindowEvent e):
Responds when a window is activated7. windowOpened (WindowEvent e):
Responds when a window loses focus
Java AWT Tutorial
Java AWT or Abstract Window Toolkit is an API used for developing GUI(Graphic User Interfaces) or Window-Based Applications in Java. Java AWT is part of the Java Foundation Classes (JFC) that provides a way to build platform-independent graphical applications.
In this AWT tutorial, you will learn the basics of the AWT, including how to create windows, buttons, labels, and text fields. We will also learn how to add event listeners to components so that they can respond to user input.
By the end of this tutorial, you will have a good understanding of the AWT and be able to create simple GUIs in Java.
Contact Us