package chuangkou;
import java.awt.*;
import java.awt.event.*;
import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JTextField;
public class Computer1 extends JFrame implements ActionListener {
int x, y, z;
JLabel label1, label2, label3;
JTextField text1, text2, text3;
Button buttonGetNumber, buttonEnter;
Computer1(String s) {
super(s);
setLayout(new FlowLayout());
buttonGetNumber = new Button("获取题目");
text1 = new JTextField(10);
label2 = new JLabel("+");
text2 = new JTextField(10);
label1 = new JLabel("=");
text3 = new JTextField(10);
buttonEnter = new Button("确认答案");
buttonEnter.addActionListener(this);
buttonGetNumber.addActionListener(this);
label3 = new JLabel(" ");
add(buttonGetNumber);
add(text1);
add(label2);
add(text2);
add(label1);
add(text3);
add(buttonEnter);
add(l
java窗口实验 (1)
最新推荐文章于 2021-06-05 11:13:16 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)