Moving a rectangle in JPanel with arrow keys using KeyListener
问题 I have been trying to make a JPanel move with the arrow keys. It has not been working. I believe it is my inner class that extends the KeyAdapter . I'm also not sure about the ActionListener implemented were it is. The other class I have made does not matter since it is just the frame. package jerryWorlds; import javax.swing.*; import java.awt.*; import java.awt.event.*; public class Jerry extends JPanel implements ActionListener{ int SizeX, SizeY, PosX, PosY, VelX, VelY; Image img; Timer