What should i do to keep my Ship on Screen if a key is keeping pushed?
Start by using current API's. keyUp()
and keyDown()
have been deprecated since JDK1.1
Start by reading Motion Using the Keyboard for some more current ideas on how to handle something like this. The code examples do basic bounds checking to make sure you can't move the component off the screen.