posted 11 years ago
you press the key, the code changes the location of whatever you want moved, then calls [container].repaint(),
so, the whatever is drawn at the new location.
if you want the whatever to keep moving whilst the key is pressed, you start a timer to do the above, keyReleased stops the timer.
I'd post a bit more detail, but as you've posted this elsewhere, I won't.
also, you may run into problems by mixing awt components with swing components