I've recently started doing some tutorials in simple game making stuff.

so far it's been pretty basic stuff I can wrap my head around or already understood.
However I've just done a tutorial on double buffering - <http://youtu.be/4T3WJEH7zrc>

Anyway, the piece of code i'm having trouble understanding is this:

```
public void paint(Graphics g) {
    dbImage = createImage(getWidth(), getHeight());     
    dbg = dbImage.getGraphics();                        
    paintComponent(dbg);                                
    g.drawImage(dbImage, 0, 0, this);                   
}

public void paintComponent (Graphics g) {           
    g.fillOval(x, y, 15, 15);                       
    repaint();                                      
}

```

So you create an image of the window, and then a graphic of that image (not too sure what the difference is there and couldn't find a simple enough definition to be satisfied with).
you then pass the image into the 2nd method which creates an oval and then the window is updated via repaint (i'm pretty sure). Then finally, back in paint, the image is drawn.

So if someone could explain the flow of info to me and the difference between a graphic vs an image and the repaint command I'd be super thankful - cheers!