Write a program to create a window and set its title with "IETE" using AWT

Ram Pothuraju
import java.awt.*;
import java.awt.event.*;
class example1 extends Frame
{
            public example1(String title)
            {
                        super(title);
                        MyWindowAdapter adapter=new MyWindowAdapter(this);
                        addWindowListener(adapter);
            }
            class MyWindowAdapter extends WindowAdapter
            {
                        example1 e1;
                        public MyWindowAdapter(example1 e1)
                        {
                                    this.e1=e1;
                        }
                        public void windowClosing(WindowEvent ae)
                        {
                                    e1.dispose();
                        }
            }
            public static void main(String args[])
            {
                        Frame f1=new Frame("IETE" );
                        f1.setVisible(true);
                        f1.setSize(200,200);
            }


 }
Tags

Post a Comment

0Comments

Post a Comment (0)