Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating a JFrame with an animated background and Swing comps on top

Status
Not open for further replies.

AdamRice32

Programmer
Dec 31, 2001
38
0
0
US
Hi All,

This is a tricky one, or so it seems to me after a while of battling with Graphics2D, Graphics, double buffered images, and the like. Basically, I've got a double-buffered image as a background for a JFrame, and I want to paint some swing components onto the JFrame as well, on top of the double-buffered image. The best I was able to do was minimize flicker, although some still exists.

I did this by creating the buffered image, drawing several things on the buffered image, telling the RepaintManager for the text field that the entire thing was dirty (markCompletelyDirty()), and then drawing the text field on the same Graphics2D object from the double-buffered image. This has minimized flickering, but it still exists and is definitely visible.

Any thoughts on how others have approached this problem before (and perhaps a code snippet) would be greatly appreciated.

Thanks in advance,
Adam
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top