【发布时间】:2016-04-30 12:09:08
【问题描述】:
在我的程序中,我必须使用 JProgress Bar 实时显示,有多少像素已经被加密......所以我在互联网上寻找,我发现我应该使用 Thread,我试过但没有工作,这是什么我已经完成了:
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();
问题还是一样,我的程序完成数据处理比将我的 jprogress 设置为 100% ..不是在进行中,而是立即! 我需要他们同时工作
【问题讨论】:
-
您需要显示更多代码,一个小的可运行可测试程序或minimal reproducible example 是最好的。这不是您的整个程序,也不是链接。
标签: java netbeans jprogressbar