How to keep game updating/running when it doesn't have OS focus

Please note: I realize that this question is a duplicate of this one, however:

  • @normen’s answer to read the app settings docs didn’t help me, and I don’t see any reference to pauseOnFocus anywhere inside of them. I also checked out the AppSettings javadoc and don’t see any reference to configuring focus-related settings; and
  • The link provided by @pspeed is now broken (this question was from 5 years ago); and
  • The other answer is vague and doesn’t provide any concrete code to derive a meaningful answer from

As such, I will ask this question again, hoping that either someone can:

  1. Provide the exact link in the docs/tutorials that answers this; or
  2. Update the (now broken) link that @pspeed originally provided; or
  3. Just provide a super-quick code snippet

So I have a barebones jME3 “game” (if you want to call it that) up and running, and I am loving life.

However, I noticed that when I click my mouse outside of the game window (hence giving focus to a diferent app running on my machine), the game comes to a screeching halt. The minute I shift focus back to my game, it resumes.

There may be conditions where I want to leave my game running in the background, and surf the internet (or do whatever) for a little while, and then come back to it. Perhaps in my game it takes 10 - 20 minutes for a tree to grow, etc., and I don’t want to just sit there and pick my nose that whole time.

So I ask: Is there any way to allow the game to keep running even when the app itself doesn’t have OS focus?

https://javadoc.jmonkeyengine.org/com/jme3/app/Application.html#setPauseOnLostFocus(boolean)

Thanks @nehon! Good to go