⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 progressthread.java~9~

📁 这是各类实用工具的源码100例
💻 JAVA~9~
字号:
package jthreadrace;import javax.swing.*;/** * <p>Title: </p> * <p>Description: </p> * <p>Copyright: Copyright (c) 2002</p> * <p>Company: </p> * @author unascribed * @version 1.0 */public class ProgressThread extends Thread {  JProgressBar pbar;//  boolean stopped;  public ProgressThread(JProgressBar pbar,int priority) {    try{    this.pbar=pbar;//    this.stopped=false;    this.setPriority(priority);    }catch(Exception err){      err.printStackTrace();    }  }//  void setStop(boolean state){//    this.stopped=state;//  }  public void run() {    /**@todo Override this java.lang.Thread method*/    int min=0;    int max=10000;    this.pbar.setMinimum(min);    this.pbar.setMaximum(max/100);    this.pbar.setValue(min);    for(int i=min; i<=max; i++){//      if(stopped)//        break;//      else{        this.pbar.setValue((int)(i/100));        this.pbar.setString(String.valueOf(i));        try{          Thread.sleep(10);        }catch(Exception err){          err.printStackTrace();        }//      }    }  }}

⌨️ 快捷键说明

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