第十三周作业第一题
来源:互联网 发布:淘宝直通车在哪开通 编辑:程序博客网 时间:2024/06/04 19:35
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Test extends JFrame implements ActionListener{
JLabel bq1;
JTextField wbk;
JButton an;
int i=0;
Test(){
bq1 = new JLabel("点击次数");
wbk = new JTextField(10);
an = new JButton("请连续点击");
an.addActionListener(this);
this.add(bq1);
this.add(wbk);
this.add(an);
this.setLayout(new FlowLayout());
this.setTitle("鼠标点击数都大比拼");
this.setSize(600,150);
this.setLocation(200, 300);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
import java.awt.event.*;
import javax.swing.*;
public class Test extends JFrame implements ActionListener{
JLabel bq1;
JTextField wbk;
JButton an;
int i=0;
Test(){
bq1 = new JLabel("点击次数");
wbk = new JTextField(10);
an = new JButton("请连续点击");
an.addActionListener(this);
this.add(bq1);
this.add(wbk);
this.add(an);
this.setLayout(new FlowLayout());
this.setTitle("鼠标点击数都大比拼");
this.setSize(600,150);
this.setLocation(200, 300);
this.setVisible(true);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
}
public static void main(String[] args) {
new Test();
}
public void actionPerformed(ActionEvent e) {
i++;
wbk.setText(""+i);
}
}
i++;
wbk.setText(""+i);
}
}
阅读全文
0 0
- 第十三周作业第一题
- 第十三周作业第二题
- 第十三周作业 2
- 第十三周作业 1
- 第十三周作业 3.0
- 第十三周作业 1.0
- 第十三周作业 2.0
- 第十三周作业 3.0
- 第十三周作业1
- 第十三周作业2
- 第十三周作业3
- 第十三周作业1
- 第十三周作业2
- 第十三周作业3
- 第十三周作业 2
- 第十三周作业 3
- 第十三周作业 4
- Geekband第十三周作业
- ASP.NET请求处理过程
- 解决svn: Can't convert string from 'UTF-8' to native encoding问题
- Drainage Ditches
- Android 8.0系统源码分析--Message发送、处理过程源码分析
- php运行出现Call to undefined function curl_init()的解决方法
- 第十三周作业第一题
- curl_init不支持的一个可行方案,亲测问题解决。
- 32. Longest Valid Parentheses
- CodeForces 45 G.Prime Problem(构造+数论)
- C++ operator关键字(重载操作符)
- Going Home
- Android布局优化之TextView、ImageView合二为一
- 刷题如需帮助,请发送源代码,题号和问题的简单描述,以便我更快更好地提供服务,非常感谢您的配合。
- OTSU 阈值计算在OpenCV中的实现