2012-08-16 34 views

回答

1

您可能正在尋找一個WindowListener

JDialog f = new JDialog(); 
f.setSize(100, 100); 
f.setVisible(true); 

f.addWindowListener(new WindowAdapter() { 

    @Override 
    public void windowIconified(WindowEvent e) { 
     System.out.println("Hi!"); 
     // Do here your custom action 
    } 

}); 
相關問題