To kill off the agents thread can't you just feed them a runnable that ends when the model ends?
To kill off the display associated with them, tell the agents thread, right before it ends, to release a permit to an external  (and initially empty) semaphore. Tell the thread calling dispose() on the jframe to acquire X (number of agents) permits from the semaphore before  killing the jframe and it should coordinate by itself.

Understand however that concurrency is easy to screw up and you might want to bone up on it rather than trusting my foggy memories of it.

On Tue, Oct 27, 2015 at 1:43 PM Rashi Aswani <[log in to unmask]> wrote:

You have X agent in each simulation, right? You have Y simulations you run.
Do you have Y threads running or do you have X*Y threads running? 

Yes, I have X agents in each simulation and Y simulations, and each simulation has a thread for each agent so X threads in one simulation. But I want to kill the X threads and corresponding display of first simulation before starting a new simulation so its a sequential process, I wanted to know if there's a way to kill the X threads and corresponding display for it.