AdamRice32
Programmer
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
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