Can anybody show me a good non-deprecated way to stop scanThread in the
following code? Setting it to null does not make her stop. What more should
I do to make her stop?
************************************************************
btScan.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent ae) {
btScanCounter++;
btScan.setText("Cancel Search");
Thread t1 = new Thread() {
public void run() {
handleScanButton();
}};
if ((btScanCounter%2) == 0) {
scanThread = null; // THIS DOES NOT WORK
btScan.setText("Auto Search");
} else {
if (scanThread == null) {
scanThread = new Thread(t1);
scanThread.start();
}
}
}});
************************************************************
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
To change your membership options, refer to:
http://www.sys-con.com/java/list.cfm