I have attached a few geometries to a node that I wish to display on the GUI. I have gotten it to display, except when I try to make it disappear after a few seconds I run into issues.
[java]
app.getGuiNode().addLight(sun);
app.getGuiNode().attachChild(promptNode);
StopWatch displayTime = new StopWatch();
displayTime.start(); //Start the prompt timer.
while (displayTime.getElapsedTimeSecs() < displayTimeSec) {} //Default 2 seconds
displayTime.stop(); //Stop the clock.
app.getGuiNode().detachAllChildren(); //Clear prompt from display
[/java]
The objects will display if I only use the first two lines. The StopWatch class just keeps track of time, and I know that works fine because the program does pause for the set time. If I removed the last line, the objects would display after the rest of the code is executed. This is not what I want. I want the objects to appear, have the stopwatch count until the time is up, then the objects to disappear.
Is there a better/easier way for doing this?
Thanks