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”

来源:学生作业帮助网 编辑:作业帮 时间:2024/08/02 08:27:28
addActionListener(this) 中的this问题public class JP extends JFrame implements ActionListener{JPanel panel1=new JPanel();.panel2.add(A=new JButton(
xMKAǿidE/ܔA:Vha]w  ,MȰU \]"3hvbE1s9)k*mK1L"gn+wo}{v>6RFU ʆRiw:G͢@*C4v{A]"X0&8)HmLqO`P _|4-op6%>ck &}i*_1܉bd3% X^f,G2\ gNTf n90𙅜wI94%3 TI듌GQ{zÞ5BNuq7óbDO'6 irzL7yV8.y=bĠ3r?p:

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”
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,请仔细回答,谢谢)

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就是指的对象本身嘛,换成A试试