this is my first threading program so sorry if this question is stupid
i need to know when the thread finishes so i can remove the matchListener, but i don't want to hang everything up waiting (see code below) , or going to all the effort of starting a thread was pointless
so what is a usual tactic?
p.s. and i just read a previous thread and am going back to work on my swing threads (edt was it?), from the MatchListener event handling
Well, I'm not sure what you mean by "without waiting for it". If the thread's not done yet, and you want to know when it's done, you generally have to either (a) force it to complete right now, (b) travel through time, or (c) wait for it to end. I don't know a good way to do (a), or any way to do (b). But (c) is pretty doable. There are, however, much better ways to do it than the code you showed, so hopefully that's what you're asking about. Probably the best way given the setup you envision would be to simply call t.join(), where join() is a method defined in the Thread class. If that doesn't work for you, try reading about wait() and notify(), defined in Object. Does that help?