WindowListener中可以实现窗口关闭功能的方法是

admin2010-12-17  32

问题 WindowListener中可以实现窗口关闭功能的方法是

选项 A、public void windowOpened(WindowEvent e)
B、public void windowClosed(WindowEvent e)
C、public void windowClosing(WindowEvent e)
D、public void windowDeactivated(WindowEvent e)

答案B

解析 本题考查事件监听器的概念。窗口事件接口WindowListener有几个关键方法,应该注意,如public void windowClosing(WindowEvent e)是把退出窗口的语句写在本方法中;public void windowOpened(WindowEvent e)是窗口打开时调用; public void windowClosed(WindowEvent e)是窗口关闭时调用,选项B正确;public void windowIconified (WindowEvent e)是窗口图标化时调用:public void windowDeiconified(WindowEvent e)是窗口非图标化时调用;public void windowActivated(WindowEvent e)是窗口激活时调用;public void windowDeactivated (WindowEvent e)是窗口非激活时调用。
转载请注明原文地址:https://kaotiyun.com/show/Q79p777K
0

最新回复(0)