digitization, transformation, binary

Abstract Class WindowAdapter in Java

Spread the love

Abstract Class WindowAdapter in Java:

WindowAdapter is an implementation of the WindowListener interface. It contains empty bodies for each of the methods of WindowListener. When we do not need to implement all the methods of WindowListener interface, Subclass -WindowAdapter helps us there.

The structure of WindowAdapter is given as:


public abstract class WindowAdapter extends Object implements WindowListener {
// Constructor: 
public WindowAdapter();
//Methods
public void windowActivated(WindowEvent e); 
public void windowClosed(WindowEvent e); 
public void windowClosing(WindowEvent e); 
public void windowDeactivated(WindowEvent e); 
public void windowDeiconified(WindowEvent e); 
public void windowIconified(WindowEvent e); 
public void windowOpened(WindowEvent e); 
} 

The details of the class structure are given as follows:

public void windowActivated(WindowEvent e); 

public void windowActivated(WindowEvent e); method actually does nothing .We need to override this function to be notified when a window is activated.

Parameter
e – The event that has occurred.

public void windowClosed(WindowEvent e); 

public void windowClosed(WindowEvent e); method actually does nothing .We need to override this function to be notified when a window is closed.

Parameter
e – The event that has occurred.

public void windowClosing(WindowEvent e); 

public void windowClosing(WindowEvent e); method actually does nothing .We need to override this function to be notified when a window is in the process of closing.

Parameter
e – The event that has occurred.

public void windowDeactivated(WindowEvent e); 

public void windowDeactivated(WindowEvent e); method actually does nothing .We need to override this function to be notified when a window is deactivated.

Parameter
e – The event that has occurred.

public void windowDeiconified(WindowEvent e); 

public void windowDeiconified(WindowEvent e); method actually does nothing .We need to override this function to be notified when an iconified window is restored.

READ  Class Observable in Java

Parameter
e – The event that has occurred.

public void windowIconified(WindowEvent e); 

public void windowIconified(WindowEvent e); method actually does nothing .We need to override this function to be notified when a window is iconified (minimized).

Parameter
e – The event that has occurred.

public void windowOpened(WindowEvent e); 

public void windowOpened(WindowEvent e); method actually does nothing .We need to override this function to be notified when a window is opened.

Parameter
e – The event that has occurred.


Spread the love

Leave a Comment

Your email address will not be published. Required fields are marked *