本帖最后由 王洪波 于 2013-5-18 23:18 编辑
窗体监听器代码如下:- f.addWindowListener(new WindowAdapter() {
- @Override
- public void windowClosing(WindowEvent e)
- {
- System.out.println("Window is closing ...");
- System.exit(0);
- super.windowClosing(e);
- }
- @Override
- public void windowClosed(WindowEvent e)//??
- {
- System.out.println("Window is closed !");
- super.windowClosed(e);
- }
- @Override
- public void windowActivated(WindowEvent e)
- {
- System.out.println("Window is Activated !");
- super.windowActivated(e);
- }
-
- });
复制代码 请问下windowClosed方法怎样才能执行到?我做试验,不行。why?
|