Update JProgressBar

后端 未结 6 1496
生来不讨喜
生来不讨喜 2021-01-22 21:43

I can\'t update my progressbar... this is my code

Thread t=new Thread(new Runnable(){
        public void run(){
            int i=1;
            jProgBar.setMin         


        
6条回答
  •  有刺的猬
    2021-01-22 21:44

    Per eugener, SwingWorker is definitely what you want to be using here, or any time a long-running task is spawned that could otherwise lock up your GUI prior to completion. A full tutorial on using progress bars with SwingWorker is available from Sun^H^H^HOracle here:

    http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html

提交回复
热议问题