if you want to interrupt/stop a thead you can use such a structure inside run()


public void run() {
while(true) {
if (isInterrupted() {
// cleanup and...