So I have a JFrame holding a JPanel, to which I'm drawing at about 60 FPS. I've been told that "Swing is double buffered by default", but, nevertheless I'm getting massive flickering. At first, I tried modifying the Graphics object from
JPanel.getGraphics(), but was not surprised when it flickered (to black, the background colour of the game so far), as I assumed that it was redrawing when I blanked the screen. However, then I overrode
paintComponent(), passing the Graphics to all objects to draw with, and made it call the super version, which I assumed would solve it, but no difference.
I'm still getting the Graphics object from the same place, i.e.
paintComponent() needs a Graphics argument. Should I be getting it from some other place? If not, what else could be causing the problem?