addActionListener(this) 中的this问题
来源:学生作业帮 编辑:百度作业网作业帮 分类:综合作业 时间:2024/08/10 12:38:47
addActionListener(this) 中的this问题
public class JP extends JFrame implements ActionListener{
JPanel panel1=new JPanel();
.
panel2.add(A=new JButton("7"));
.
A.addActionListener(this);
.
}
1.这个this是调用当前对象?
2.如果我不想用“this” 可以换成什么?(这个是为了更深入的了解this,请仔细回答,谢谢)
public class JP extends JFrame implements ActionListener{
JPanel panel1=new JPanel();
.
panel2.add(A=new JButton("7"));
.
A.addActionListener(this);
.
}
1.这个this是调用当前对象?
2.如果我不想用“this” 可以换成什么?(这个是为了更深入的了解this,请仔细回答,谢谢)
![addActionListener(this) 中的this问题](/uploads/image/z/3231918-54-8.jpg?t=addActionListener%28this%29+%E4%B8%AD%E7%9A%84this%E9%97%AE%E9%A2%98)
this就是指的对象本身嘛,换成A试试
再问: 饿。。你说的不对 不是A 如果说可能的话 也应该是JP(也并不是单纯的JP)。 是JP实现了 ActionListener这个接口
再问: 饿。。你说的不对 不是A 如果说可能的话 也应该是JP(也并不是单纯的JP)。 是JP实现了 ActionListener这个接口
addActionListener(this) 中的this问题
JQ插件中的this指向问题
this,that的问题
this
this.
MainActivity中的this是什么
THIS IS IT歌曲问题
What's this回答问题
javascript中的this指向谁
专四语法题中的问题:This may have preserved the elephant from being wi
This factory is where I worked last year中的where的问题
英语阅读中的问题This officer was standing across a small counter fro