下载此文档

java计时器(秒表)程序代码.doc


文档分类:IT计算机 | 页数:约8页 举报非法文档有奖
1/8
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/8 下载此文档
文档列表 文档介绍
Java计时器(秒表)功能:能实现计时,暂停,清零,记录功能。如下图:程序运行状态:源代码:.*;.*;.*;lassTest{ publicstaticvoidmain(String[]args){ newwindow("计时器"); }}classwindowextendsJFrame{ intON=0,i=0,j=0,k=0,count=0,num=1,R=0; JButtonbutton1,button2,button3,button4,button5; JTextFieldfile1,file2,file3; JTextAreafile; FlowLayoutflow; Stringa,b,c; window(Stringname) { file1=newJTextField(2); file2=newJTextField(2); file3=newJTextField(2); (false); (false); (false); file=newJTextArea(10,8); (false); button1=newJButton("开始"); button2=newJButton("暂停"); button3=newJButton("清零"); button4=newJButton("记录"); button5=newJButton("清空记录"); flow=newFlowLayout(); (); (20); (10); setTitle(name); setSize(210,400); setLayout(flow); add(file1); add(newJLabel(":")); add(file2); add(newJLabel(":")); add(file3); add(button1); add(button2); add(button3); add(button4); add(button5); add(file); setVisible(true); setDefaultCloseOperation(EXIT_ON_CLOSE); ("0"); ("0"); ("0"); validate(); (newActionListener(){ publicvoidactionPerformed(ActionEvente){ ON=1;//开始,暂停控制开关} });//开始按钮 (newActionListener(){ publicvoidactionPerformed(ActionEvente){ ON=0; } });//暂停按钮 (newAct

java计时器(秒表)程序代码 来自淘豆网m.daumloan.com转载请标明出处.

非法内容举报中心
文档信息
  • 页数8
  • 收藏数0 收藏
  • 顶次数0
  • 上传人1006108867
  • 文件大小34 KB
  • 时间2019-06-17