timer.java

来自「用Java编写的天气预报软件」· Java 代码 · 共 43 行

JAVA
43
字号
/*
 * Timer.java
 * Download by http://www.codefans.net
 * Created on 2007年9月5日, 上午10:13
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package weather;
import java.util.*;
import javax.swing.*;
/**
 *
 * @author yuhui_bear
 */
public class Timer extends Thread{
    private Map<String , String> map;
    private mainFrame mf;
    private String mplace;
    private JProgressBar pbar;
    private JTabbedPane jtp;
    /** Creates a new instance of Timer */
    public Timer(Map<String,String> fc_in , mainFrame frame , JTextField tf , JProgressBar bar , JTabbedPane jtpin) {
        map = fc_in;
        mf = frame;
        pbar = bar;
        jtp = jtpin;
        mplace = tf.getText().trim();
    }
    public void run(){
        try{
            while(true){
                new Updater("updater" , map , mf , mplace ,pbar ,jtp);
                sleep(900000);
            }
        }catch(InterruptedException ex){
            System.err.println("sleep failed");
        }
            
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?