moving buffered image to specific coordinates
问题 I am trying to move the blue square around the grid by pressing the arrow keys. I already set up the KeyListener but when I repaint the frame, I have to move the frame around in order for it to update. How do I make it a smooth animation (moving the square from one coordinate to another)? Example: if (keyCode == KeyEvent.VK_LEFT){ x5=x5-xChange; frame.repaint(); } My images are buffered images and are all set to specific coordinates. Here is my graphics class: public static class