一、 选择 1、按钮可以产生ActionEvent事件,实现哪个接口可处理此事件?
A FocusListener
B ComponentListener
C WindowListener
D ActionListener
二、多项选择 1、实现下列哪个接口可以对TextField对象的事件进行监听和处理?
A ActionListener
B FocusListener
C MouseMotionListener
D WindowListener E ContainerListener 2、TextArea对象可以注册下列哪些接口?
A TextListener
B ActionListener
D MouseListener E ComponentListener
三、 填空题 1、 传递给实现了java.awt.event.MouseMotionListener接口的类中mouseDragged()方法的事件对象是 类型的。 2、 当用户在TextField中输入一行文字后,按回车,实现 接口可实现对事件的响应。
四、程序填空题 1、 import java.awt.*; import java.awt.event.*; public class MyApplet extends java.applet.Applet { public void init() { Button b = new Button("Button1"); b.addMouseListener(new ClickHandler()); add(b); } class ClickHandler extends MouseAdapter { public void mouseClicked(MouseEvent evt) { } } }