public interface WindowListener extends EventListener
WindowAdapter
类(仅覆盖感兴趣的方法)。
然后使用该窗口的addWindowListener
方法将该类创建的侦听器对象注册到一个窗口中。
当窗口的状态由于打开,关闭,激活或停用,图标化或去隐藏而变化时,将调用侦听器对象中的相关方法,并将WindowEvent
传递给它。
WindowAdapter
, WindowEvent
, Tutorial: How to Write Window Listeners
Modifier and Type | Method and Description |
---|---|
void |
windowActivated(WindowEvent e)
当窗口设置为活动窗口时调用。
|
void |
windowClosed(WindowEvent e)
当窗口关闭时调用窗口调用处理结果时调用。
|
void |
windowClosing(WindowEvent e)
当用户尝试从窗口的系统菜单中关闭窗口时调用。
|
void |
windowDeactivated(WindowEvent e)
当窗口不再是活动窗口时调用。
|
void |
windowDeiconified(WindowEvent e)
当窗口从最小化更改为正常状态时调用。
|
void |
windowIconified(WindowEvent e)
当窗口从正常状态更改为最小化状态时调用。
|
void |
windowOpened(WindowEvent e)
第一次调用窗口可见。
|
void windowOpened(WindowEvent e)
void windowClosing(WindowEvent e)
void windowClosed(WindowEvent e)
void windowIconified(WindowEvent e)
void windowDeiconified(WindowEvent e)
void windowActivated(WindowEvent e)
void windowDeactivated(WindowEvent e)