请教各位大虾!一个关于线程的小问题!
public class ThreadUser extends Thread{
private JLabel label = new JLabel();
private boolean doing = true;
private int i = 1;
public ThreadUser(JLabel lab) {
label = lab;
}
public void run()
{
try{
while(doing){
label.setText(Integer.toString(i));
i += 5;
Thread.sleep(200); }
synchronized(this){
while(!doing){ wait(); }
}
}
catch( InterruptedException e ){}
}
public void stopp()
{
doing = false;
notify();
}
public void parse()
{
doing = false;
}
public synchronized void redo()
{
doing = true;
notify();
}
}
当调用了parse()方法后,实现了暂停的作用。但是,当调用redo()方法后却不能实现继续计数的功能?
请问各位大虾:小弟的问题出在哪呢???
谢谢!!!!!!!