You can tell Swing to do active rendering (although the article is in the "fullscreen" section, it works under windowed mode too!):
http://docs.oracle.com/javase/tutorial/extra/fullscreen/rendering.htmlHere is how to disable passive rendering:
Use the setIgnoreRepaint method on your application window and components to turn off all paint events dispatched from the operating system completely, since these may be called during inappropriate times, or worse, end up calling paint, which can lead to race conditions between the AWT event thread and your rendering loop.