Swing automatically enables double-buffering - see Double Buffering Support. If you use the framework correctly, you shouldn't have problems with flashing.

If you want full control over screen...