Moving objects in paintComponent void
In my program, I hit the right arrow and the box should move over... However, this is not the case. I can not think of any good way to move this box. I have tried putting a while loop in the paintComponent method that checks for a boolean. Then when I hit the arrow, the boolean becomes true. This does not work. I know why, but I cant fix it. The problem is that when I add the class with the paintComponent void to a JFrame, it only runs through the void once to add graphics. How can I achive my goal?
If tl;dr. Here is my question in a nutshell.
I cant get my green box to move. Help.
Re: Moving objects in paintComponent void