为什么我用了interrupt之后线程不会停止,API上说可以中断线程的啊。代码如下:public class dfdfdfdf extends JFrame { dfdfdfdf(){
final Thread th=new Thread(new Runnable(){
public void run(){
while(true){
System.out.println("*");
}
}
});
JButton b=new JButton("OK");
add(b);
pack();
setVisible(true);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
b.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
th.interrupt();
}
});
th.start();
}

public static void main(String[] args) {
new dfdfdfdf();
}}