Auto refresh

I’ve periodically adding new objects (cylinders) to the scene graph where nothing is moving including the camera. I expect to be able to see the cylinders immediately, but they often don’t show up until I drag the screen a bit, just to force a repaint.

Sometimes the new objects appear. I’m not sure, but I think it’s related to whether or not the viewport has the focus. Could this be related to the fact that I’m running jME3 inside of a Swing frame?

How can I force continuous updates, so that the display is always up-to-date?



How do you use jME in a swing frame? With the Canvas or by copying the render output to an AWT image? If you do the latter, try adding a swingPanel.refresh() to the paint method (dont worry, its thread safe and will only repaint on the AWT thread and also only when possible)

Try Application.setPauseOnLostFocus(false)

1 Like