我没有爱人i
回答时间:2019-12-05
向TA提问
加法和减法我都给你实现了 你感受下
import java.awt.*;
import java.awt.event.*;
public class jiafa extends WindowAdapter implements ActionListener {
Frame f;
TextField txt1;
TextField txt2;
TextField txt3;
Label lbl1;
Label lbl2;
Label lbl3;
Button btn1;
Button btn2;
Button btn3;
Button btn4;
void init() {
f = new Frame("计算器");
lbl1 = new Label("x");
lbl2 = new Label("y");
lbl3 = new Label("结果");
txt1 = new TextField(10);
txt2 = new TextField(10);
txt3 = new TextField(10);
b