And what happened when you tried that?

By the way, putting your game logic inside an infinite loop like that probably isn't a good idea. It's better to use a Timer.