Listener问题
来源:百度知道 编辑:UC知道 时间:2024/06/09 10:15:16
f.addWindowListener(new WindowAdapter() //创建匿名的内部类,事件适配器
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
jRadioButton1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
为什么一个listener是那new Adapter,一个是new listener?
请详细解析,谢谢
{
public void windowClosing(WindowEvent e)
{
System.exit(0);
}
});
jRadioButton1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
}
});
为什么一个listener是那new Adapter,一个是new listener?
请详细解析,谢谢
windowAdapter是实现了windowListener接口的类 这个接口里面有很多个方法 而现在只需要其中一个窗口关闭的方法 为了方便 所以从windowAdapter继承 重写需要的方法即可 ActionListener里面只有一个方法 所以可以直接实现
同上:windowAdapter是实现了windowListener接口的类
查查API就能发现。如果是父类有的功能的话当然都可以用。
audience和listener之间的区别是什么?
午夜听众The Night Listener(2006)
“旁听者”用listener表示准确吗?
求救web.xml中的<listener></listener>有什么用?
What is your definition of a good listener?
哪位高手帮忙翻译"the listener"(from College English Book 3)
谁能帮我翻译这篇英语文章Become a Better Listener
I'm an excellent listener who likes to hear the voice of the woman I'm with.
问题???
问题~~~~~~~~~