if(thread1.isInterrupted()){
thread1.interrupted();//a
thread1.start();}
else
thread1.interrupt();//b
a,b两个地方有点矛盾吧。
使用stop(),在MyFrame里设置一个boolean变量来监控。
thread1.interrupted();//a
thread1.start();}
else
thread1.interrupt();//b
a,b两个地方有点矛盾吧。
使用stop(),在MyFrame里设置一个boolean变量来监控。
thread1.wait();
isRunning = false;
}else {
thread1.notify();
isRunning = true;
}