Skullbox
Skullbox

Reputation: 441

My java program freezes when other window is active

I have developed a java program that runs fine in Mac OS X (10.6.7). But if I click on another window such as Finder or another application, my program freezes, or the graphics are not updated anymore. If I click on my program again the graphics are updated again and runs well.

Does anyone know what that can be?

I coded it with the LWJGL and slick libraries.

Thanks!

Upvotes: 0

Views: 665

Answers (1)

esaj
esaj

Reputation: 16035

Taken from here:

By default slick will not render anything if it does not have focus, so good practice for applets is to set

container.setAlwaysRender(true);

so that it always renders even when it doesn't have focus.

This seems to refer to GameContainer.setAlwaysRender. Although the forum post talks about applet, both AppGameContainer (standalone-application) and AppletGameContainer.Container extend from it.

Upvotes: 1

Related Questions