Hi all
I want some actions to take place in a Main-***** thread and not in a AWT-EventQueue-*** thread
but those actions are targetted by a JMenuItem, and thus follow the AWT event pathway
What I do know is launch a Thread from the main() with a
run()
{
while(true)
{
if(flag)
{
//do the actions
flag = false;
}
yield();
}
}
and the JMenuItem sets the flag to true, when i need the code to be executed
the problem is that the while(true) yield(); take 100% of the CPU (though it is not realy slowing the computer)
but if a start/stop the thread just when i need instead of starting it withing the main(), it ends up in the AWT-EventQueue, and that is bugging the display() thread of my renderer
thx for any clue