does a thread run until you stop it java code example
Example: java how to stop a thread
Thread t = new Thread();
try {
//{...your thread code here...}
//at the end of the 'try{}' block..
t.interrupt();
} catch (InterruptedException e) {} //or whatever Exception your Thread will launch