Answers for "code to close the gui window using awt"

0

how to close a window in awt program

public class AdapterExample extends WindowAdapter{  
    Frame f;  
    AdapterExample(){  
        f=new Frame();  
        f.addWindowListener(this);  
          
        f.setSize(400,400);  
        f.setLayout(null);  
        f.setVisible(true);  
    }  
public void windowClosing(WindowEvent e) {  
    f.dispose();  
}  
public static void main(String[] args) {  
    new AdapterExample();  
}
Posted by: Guest on April-07-2021

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language