Hi could anyone explain this program to me please.
public class WindowInnerDemo extends Frame
{
public WindowInnerDemo()
{
addWindowListener(new MyWindowInner(this)); //Line1
}
public void paint(Graphics g)
{
g.drawString("This is a frame",10,100);
}
p.s.v.m(String args[])
{
WindowInnerDemo w=new WindowInnerDemo();
w.setTitle("Myframe");
w.setVisible(true);
w.setSize(400,400);
w.show();
}
class MyWindowInner extends WindowAdapter
{
WindowInnerDemo w;
MyWindowInner(WindowInnerDemo w1)
{
w=w1;
}
public void windowClosing(WindowEvent we)
{
w.setVisible(false);
}
}
}
What is the meaning of new MyWindowInner(this) in Line 1 comment.
2007-07-10
14:09:01
·
2 answers
·
asked by
anusha
1
in
Computers & Internet
➔ Programming & Design