在我的程序中我必须使用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]将是最好的。这不是你的整个程序,也不是一个链接。 –