在我的程序中我必須使用JProgress酒吧實時顯示多少像素已經加密..所以我在互聯網上看,我發現我應該使用線程,我試過但不工作,這裏是我做了什麼:java netbeans和jprogress吧
public class progress_barr extends Thread
{
public void run()
{
JPB_crypt.setValue(prog); // prog is manipulated in showpixels function
System.err.println("progress here !");
}
}
public class calculate extends Thread
{
public void run()
{
showPixel();
}
}
比我晚打電話給他們,這是我如何使用它
JPB_crypt.setValue(0);
appel=1; // to initiate show function
calculate calc = new calculate();
progress_barr pb = new progress_barr();
calc.start();
pb.start();
問題還是一樣,我的程序完成數據處理比設定我的進步到100%..不是在進步,而是在一次! 我需要它們同時工作
你需要表現出更多的代碼,一個小的可運行可測試的程序或[MCVE]將是最好的。這不是你的整個程序,也不是一個鏈接。 –