You need to hang on to a reference to the thread in question, and then call thread.interrupt().
You should only do this with threads you have created yourself, not with AWT threads that call your paint methods or event handlers. The article referenced in the javadocs for several Thread methods (e.g. Thread.sleep) talks about thread handling in the context of AWT events; that should be helpful reading for what you're doing.