I'm doing a gameengine including a physics and graphics engine. Right now my graphics engine is set to 60 fps, and sometime i notice slow updates on the screen. I have a JFrame which i add a JPanel to which moves around, meaning the graphic engine does frame.repaint() every loop. I'm starting to believe that this repainting on the frame does the small delay on screen.
The delay is such that the JPanel moves in a straight line, and suddenly it can jump a bit further than usual.
Is it better to put a JPanel "gameField" on the JFrame and then add a JPanel "player" to the gameField and repaint the gameField instead? Or is it basically the same thing as repainting the JFrame? I just heard that the JFrame is supposed to be a heavy component.
I've tried setting higher fps, which changes nothing.