新手求解 22行 this 什么意思
import java.awt.*;import java.awt.event.*;
public class TMath
{
public static void main(String[] args)
{
new TFFrame().launchFrame();
}
}
class TFFrame extends Frame
{
TextField num1,num2,num3;
public void launchFrame()
{
num1=new TextField(10);
num2=new TextField(10);
num3=new TextField(10);
Label n1=new Label("+");
Button n2=new Button("=");
TFMonitor t=new TFMonitor(this);
setLayout(new FlowLayout());
add(num1);
add(n1);
add(num2);
add(n2);
add(num3);
n2.addActionListener(t);
pack();
setVisible(true);
}
class TFMointor implements ActionListener
{
public void actionPerformed(ActionEvent e)
{
int n1=Integer.parseInt(num1.getText());
int n2=Integer.parseInt(num2.getText());
num3.setText(""+(n1+n2));
}
}
}