public void stopVisualizing() { synchronized (startStopSynchObject) { if (!currentlyRunning || currentlyStopping) { return; } currentlyStopping = true; if (currentlyStarting) { System.err.println( "Got through all of the stopping conditions, we're going to stop... but its currently starting....ahhh"); } } // tell them all to die for (RenderObject thisRunner : theRenderObjects) { thisRunner.kill(); } // wait for them all to be done for (Thread thisThread : theThreads) { try { thisThread.join(); } catch (InterruptedException e) { // TODO Auto-generated catch block e.printStackTrace(); } } theThreads.removeAllElements(); synchronized (startStopSynchObject) { currentlyStopping = false; currentlyRunning = false; } }