如何从 actionlistener 中退出我的程序。我有两个线程,thread1 和 thread2。一个线程在 actionlistener 中。但我希望其他线程退出此操作侦听器并管理其余代码。我该怎么做?
sendtkttgt.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
Thread thread1= new Thread(){
public void run(){
SendingLogictoTGT obj=new SendingLogictoTGT();
try {
try {
obj.main(null);
} catch (InterruptedException ex) {
}
} catch (IOException ex) {
// System.exit(1);
}
}
};
/*Thread thread2= new Thread(){
public void run(){
//I want to exit from this actionlistener
}
};
*/
thread1.start();
}
});