
我用的是eclips3.2版的编程工具~~
import javax.swing.*;
/**********************************************************
*A simple demonstration of a window constructed with Swing.
**********************************************************/
public class FirstSwingDemo
{
public static final int WIDTH = 300;
public static final int HEIGHT = 200;
public static void main(String[] args)
{
JFrame myWindow = new JFrame();
myWindow.setSize(WIDTH, HEIGHT);
JLabel myLabel = new JLabel("Please don't click that button!");
myWindow.getContentPane().add(myLabel);
WindowDestroyer myListener = new WindowDestroyer();
myWindow.addWindowListener(myListener);
myWindow.setVisible(true);
}
}
WindowDestroyer 这个类不能解析,宏答就是少引入这个类了。应该是楼主没答绝正写源码还的其他附属类了,看看书上清悔有没有WindowDestroyer 这个类的代码段,写多个类就可以了!!
最好把代码贴出来看看