Swing中要响应动作事件必须实现ActionListener接口,而实现ActionListenrer接口必须实现的方法是 ( )。

admin2010-07-28  29

问题 Swing中要响应动作事件必须实现ActionListener接口,而实现ActionListenrer接口必须实现的方法是 (    )。

选项 A、actionPerfonned()
B、focusGained()
C、actionMoved()
D、focusLost()

答案1

解析 本题考查关于事件响应中ActionListener方法的基本知识。选项A正确, actionPerformed()方法是ActionListener接口中的唯一方法;选项B错误,focusGained()方法是FocusListener接口中的方法:选项C错误, ActionListener接口中没有actionMoved();选项D错误,focusGained()方法是FocusListener接口中的方法。故本题答案是A。
转载请注明原文地址:https://jikaoti.com/ti/YaH0FFFM
0

随机试题
最新回复(0)