怎么修改?
- Java code
import java.awt.event.*;import java.awt.*;class TestStopWatch extends Frame{ public TestStopWatch() { addWindowListener(new WindowAdapter() { public void WindowClosing(WindowEvent e) { dispose(); System.exit(0); } }); } public static void main(String []args) { TestStopWatch sw=new TestStopWatch(); sw.setSize(400,400); sw.setVisible(true); }}
------解决方案--------------------
public void WindowClosing(WindowEvent e)
改为public void windowClosing(WindowEvent e)
方法名首字母小写