In writing a program that runs through a series of images, I instansiate an Animator object and call start() at the appropriate time (which runs a thread to continuously call the display method of my GLEventListener [that is: my JFrame]). When through displaying this series of images, I call my animator’s stop() method.
The problem lies in that the stop() method kills the current rendering thread, which then traverses the stack to kill all the other threads. At that point, the program goes into a deadlock and I have no control of the monitor state.
I first attempted just leaving the animator’s thread as the new main thread, but after all the images are through there is a constant, repeated EOF exception.
I tried setting my animator to null, but its thread kept on calling the display() method regardless (a complete waste).
Is there some way to go back to my original (AWTEvent-0) main thread that simply has wait() and notify() [for all intents and purposes]?
I use javax.swing.JFrame and net.java.games.jogl.Animator
Also, both my original main and the animator’s thread have priority=6…if that helps
(It would be nice if i could get rid of that animator’s thread altogether, without destroying all the others.)