Hello my name is turtle. I am having trouble trying to get an oval to move(any direction) using a visual game like window in java. The problem is is after all my work the ball doesn't move nomatter what. Here is the code:
To start with you didn't post the code in code tags so it's now difficult to read which means I won't do anything other than give it a cursory glance.
You shouldn't be trying to draw on, add KeyListeners to etc a JFrame, you should be using a JComponent such as a JPanel, which you add to the JFrame.
When handling the drawing yourself you shouldn't override the paint method, you should override the paintComponent method instead - read the Java tutorial on 2D graphics
Bookmarks