I have a \"car\" made with various objects using graphics g and I want to move it when a button is pressed. With that, I had no problem, but I have a problem with its path. When
You probably forgot to call
super.paintComponent(g);
in your paintComponent() method
paintComponent()
@Override protected void paintComponent(Graphics g){ super.paintComponent(g); //Clear screen before redraw //Your codes for painting.. }