class myThread extends Thread{
private testData data;public myThread(testData data){
this.data=data;
}
 
@Override 
public void run() {
try {
this.sleep(5000);                          //这个线程睡5S
} catch (InterruptedException e) {
e.printStackTrace();
}
synchronized (this.data){                  //这个this指向class myThread 的 data,为什么
                                           //对它同步呢?
int i=0;
while(i<1000){
this.data.a=this.data.a.substring(0, 3)+i;
System.out.println(i++);
}
}
}};
在我看来这个线程,只是起了一个打印作用,对你的按钮 不会有什么影响