title: How to make a loading screen during a resource heavy operation
body: <p>I'm trying to make a loading screen for a game that shows whenever a level is being generated. When the game isn't doing anything, the loading screen works just fine. But when I put in the code to generate levels, the loading screen is a blank screen and the application becomes unresponsive until the loading is done. The question is, how can I make it so the level generator doesn't interfere with the loading screen and the rest of the application? I'm using the swing timer to control the loading animation. And I don't want to use threads because the level generator will be used multiple times, and I know that a thread's run method can only be called once.</p>