TimeCount.java
资源名称:扫雷(java).rar [点击查看]
上传用户:penghbff
上传日期:2007-04-16
资源大小:32k
文件大小:1k
源码类别:
射击游戏
开发平台:
Java
- import java.awt.*;
- import javax.swing.*;
- public class TimeCount extends Thread
- {
- JTextField textShowTime;
- int i=0;
- public TimeCount()
- {
- textShowTime=new JTextField(5);
- textShowTime.setEditable(false);
- textShowTime.setFont(new Font("Plaint",Font.BOLD,24));
- textShowTime.setHorizontalAlignment(JTextField.RIGHT);
- }
- public void run()
- { i=0;
- while(i<=999)
- {
- textShowTime.setText(""+i);
- i++;
- try{
- sleep(1000);
- }
- catch(InterruptedException e){
- break;
- }
- }
- }
- }