import java.awt.*;
import java.awt.event.*;
public class Inside
{
private Frame f=new Frame("use Listenered");
private TextArea ta=new TextArea(6,40);
public void Init(){
f.addWindowListener(new MyListener());
f.add(ta);
f.pack();
f.setVisible(true);
}
class MyListener implements WindowListener
{
public void windowOpened(WindowEvent e)
{
ta.append("window is first open\n");
}
public void windowClosing(WindowEvent e)
{
ta.append("window is open\n");
System.exit(0);
}
public void windowClosed(WindowEvent e)
{
ta.append("window was closed\n");
}
public void windowDeactivated(WindowEvent e){
ta.append("lose it\n");
}
public void windowActivated(WindowEvent e){
ta.append("window is life\n");
}
public void windowDeiconified(WindowEvent e){
ta.append("window back\n");
}
public void windowIconified(WindowEvent e)
{
ta.append("window is smallest\n");
}
}
public static void main(String[] args){
new Inside().Init();
}
}
import java.awt.event.*;
public class Inside
{
private Frame f=new Frame("use Listenered");
private TextArea ta=new TextArea(6,40);
public void Init(){
f.addWindowListener(new MyListener());
f.add(ta);
f.pack();
f.setVisible(true);
}
class MyListener implements WindowListener
{
public void windowOpened(WindowEvent e)
{
ta.append("window is first open\n");
}
public void windowClosing(WindowEvent e)
{
ta.append("window is open\n");
System.exit(0);
}
public void windowClosed(WindowEvent e)
{
ta.append("window was closed\n");
}
public void windowDeactivated(WindowEvent e){
ta.append("lose it\n");
}
public void windowActivated(WindowEvent e){
ta.append("window is life\n");
}
public void windowDeiconified(WindowEvent e){
ta.append("window back\n");
}
public void windowIconified(WindowEvent e)
{
ta.append("window is smallest\n");
}
}
public static void main(String[] args){
new Inside().Init();
}
}