The cancel method doesn't cancel gracefully. It terminates a thread and allows the thread to attempt to clean up gracefully.
The recommended method to cancel a thread is to use application logic. For example, add a "stopMe()" method to the thread class that sets a "shutdown" flag in the class and let the thread logic interrogate it periodically. If the flag has been set, then the thread should halt what it was doing and clean up.
The difference between this technique and a cancel() is that your termination happens at a controlled point rather than immediately no matter what you are doing. Which generally means that cleanup will be easier.
Of course, if the stopMe() doesn't shutdown the thread in a reasonable length of time, then the thread is probably either hung up on a resource or out of control. THAT's when you cancel() it.
An IDE is no substitute for an Intelligent Developer.