Java 算数测试小程序
来源:IT的点点滴滴 责任编辑:栏目编辑 发表时间:2013-07-02 01:37 点击:次
TestFrame.java
- import javax.swing.*;
- import java.awt.FlowLayout;
- import java.awt.event.*;
- public class TestFrame extends JFrame implements ActionListener
- {
- JTextField textOne,textTwo,textResult;
- JButton getProblem,giveAnwser;
- JLabel operatorJLabel,message;
- TestOperator testOperator;
- public TestFrame()
- {
- testOperator=new TestOperator();
- setLayout(new FlowLayout());
- textOne=new JTextField(10); //创建textOne,其可见字符长是10
- textTwo=new JTextField(10); //创建textTwo,其可见字符长是10
- textResult=new JTextField(10); //创建textResult,其可见字符长是10
- operatorJLabel=new JLabel("+");
- message=new JLabel("你还没有回答呢");
- getProblem=new JButton("获取题目");
- giveAnwser=new JButton("确认答案");
- add(getProblem);
- add(textOne);
相关新闻>>
- 发表评论
-
- 最新评论 更多>>