[问答题] 下面程序中,在主窗口单击鼠标后,就会生成一个新窗口。
import java.awt.*;
import java.awt.event.*;
public class java3 extends Frame
java3()
super("java3");
addNotify();
addWindowListener(new WindowAdapter()
public void windowClosing(WindowEvent e)
System.exit(0);
);
Insets insets=getInsets();
setSize(insets.left+insets.right+150,
insets.top+insets.bottom+150);
this.addMouseListener(MouseEventHandler());
class MouseEventHandler implements MouseAdapter
public void mousePresse(MouseEvent evt)
Rectangle bounds=getBounds();
int x=evt.getX()+bounds.x;
int y=evt.getY()+bounds.y;
java3 m=newjava3();
m.setLocation(x,y);
m.show();
static public void main(Strin