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

admin2010-02-22  30

问题 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)

答案2

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

最新回复(0)