timer.java

来自「java 多线程文件下载器源代码......」· Java 代码 · 共 74 行

JAVA
74
字号
//package com.sam.net.download;
//
//public class Timer extends Thread
//{
//
//	int ss;
//	int mm;
//	int hh;
//
//	public Timer()
//	{
//		ss = 0;
//		mm = 0;
//		hh = 0;
//	}
//
//	public void run()
//	{
//		do
//		{
//			if (ss < 10 && mm < 10 && hh < 10)
//				MainFrame.yunxingtime.setText((new StringBuilder("程序已运行:0")).append(hh).append(":0").append(mm).append(":0").append(ss).toString());
//			else
//			if (ss < 10 && mm >= 10 && hh < 10)
//				MainFrame.yunxingtime.setText((new StringBuilder("程序已运行:0")).append(hh).append(":").append(mm).append(":0").append(ss).toString());
//			else
//			if (ss < 10 && mm >= 10 && hh >= 10)
//				MainFrame.yunxingtime.setText((new StringBuilder("程序已运行:")).append(hh).append(":").append(mm).append(":0").append(ss).toString());
//			else
//			if (ss < 10 && mm < 10 && hh >= 10)
//				MainFrame.yunxingtime.setText((new StringBuilder("程序已运行:")).append(hh).append(":0").append(mm).append(":0").append(ss).toString());
//			else
//			if (ss >= 10 && mm < 10 && hh < 10)
//				MainFrame.yunxingtime.setText((new StringBuilder("程序已运行:0")).append(hh).append(":0").append(mm).append(":").append(ss).toString());
//			else
//			if (ss >= 10 && mm >= 10 && hh < 10)
//				MainFrame.yunxingtime.setText((new StringBuilder("程序已运行:0")).append(hh).append(":").append(mm).append(":").append(ss).toString());
//			else
//			if (ss >= 10 && mm >= 10 && hh >= 10)
//				MainFrame.yunxingtime.setText((new StringBuilder("程序已运行:")).append(hh).append(":").append(mm).append(":").append(ss).toString());
//			else
//			if (ss >= 10 && mm < 10 && hh >= 10)
//				MainFrame.yunxingtime.setText((new StringBuilder("程序已运行:")).append(hh).append(":0").append(mm).append(":").append(ss).toString());
//			if (ss >= 59)
//			{
//				ss = 0;
//				if (mm >= 59)
//				{
//					mm = 0;
//					hh++;
//				} else
//				{
//					mm++;
//				}
//			} else
//			{
//				ss++;
//			}
//			try
//			{
//				sleep(1000L);
//			}
//			catch (InterruptedException e)
//			{
//				e.printStackTrace();
//			}
//			String as[];
//			if (MainFrame.tablemodel.downloadingList.size() != 0)
//				as = new String[MainFrame.tablemodel.downloadingList.size()];
//			MainFrame.renwushulb.setText((new StringBuilder("正在运行的任务数:")).append(MainFrame.tablemodel.downloadingList.size()).toString());
//		} while (true);
//	}
//}

⌨️ 快捷键说明

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