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

admin2010-02-22  29

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

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

答案1

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

最新回复(0)