windowDeactivated在Mac上不起作用

时间:2013-05-04 11:32:59

标签: java macos swing jdialog

我有以下代码:

public AudioDialog() {

        this.addWindowListener(new WindowListener() {
          public void windowActivated(WindowEvent e) {

          }

          public void windowClosed(WindowEvent e) {

          }

          public void windowClosing(WindowEvent e) {

          }

          public void windowDeactivated(WindowEvent e) {
              System.out.println("deactivated");
              dispose();
          }             

          public void windowDeiconified(WindowEvent e) {

          }

          public void windowIconified(WindowEvent e) {

          }

          public void windowOpened(WindowEvent e) {

          }
      });

    }
当JDialog失去焦点时,

windowDeactivated在Windows下正确执行,但在Mac下没有任何事情发生。

有人可以告诉我我做错了吗?

0 个答案:

没有答案