button.addActionListener(this)中的this是啥意思,是指button本身还是该代码所在类,能用其他等效吗?

来源:学生作业学帮网 编辑:学帮网 时间:2024/06/25 04:10:42

button.addActionListener(this)中的this是啥意思,是指button本身还是该代码所在类,能用其他等效吗?

该代码所在类,可以用,比如
button.addActionListener(new ActionListener() {
  //所有ActionListener的函数定义
...});