Hold Key Repeat Rate / Threads

view full story

http://www.daniweb.com – Hi, in a Java Applet there the keys control movement, I have a couple of questions (sorry for the disorganized nature of multi-item requests). 1. if (key=KeyEvent.VK_RIGHT) {     x++; } But, as you might have guessed by this post's title, the movement delays before continuing its motion, as a letter doesn't repeat while typing until you hold it down for a noticeable bit. 2. If I want something to just happen continually, like an artificial intelligence/gravity & physics, do I need a thread, or can I just place a while(True) loop in init() or start()? My bountiful thanks! (General)