I see. That seems pretty cool.
What's the point to having the double do-while loops though?
If I'm understanding this right, the pseudo-code for the loop would be something like:
As long as I'm running...
update the game logic.
Borrow the buffer's graphics object.
Do my drawing with it.
Toss it, I'm done drawing.
If there is still things that need to be drawn on the buffer, I'll do it again.
If the buffer's been flipped and drawn, I'll do it again.
Take a nap.
I'm not seeing the need for 2 do-while loops for drawing....Oh....wait. Double buffering.....right...
So, what exactly does contentsRestored() and contentsLost() check for? The javadoc doesn't explain it well.