code: private void scheduleUpdate() {
  		if (!isVisible()) {
  			return;
  		}
  		
  		SwingUtilities.invokeLater(new Runnable() {
  			public void run() {
  				try {
  					container.gameLoop();
  				} catch (SlickException e) {
  					e.printStackTrace();
  				}
  				container.checkDimensions();
  				scheduleUpdate();
  			}
  		});
  	}
docs: Schedule an update on the EDT