Re: Double buffer help




"Ian Shef" <invalid@xxxxxxxxxxxxx> wrote in message
news:Xns979A7C7A78E98vaj4088ianshef@xxxxxxxxxxxxxxxxxx
"Martin" <zedolf@xxxxxxxx> wrote in
news:v72dnULQsrw6WLLZnZ2dnUVZ8s-dnZ2d@xxxxxxxxx:


"Martin" <zedolf@xxxxxxxx> wrote in message
news:Eemdne5N39tdvrLZnZ2dnUVZ8qGdnZ2d@xxxxxxxxxxxx
I'm a newbie to Java and have today completed my first Java applet.

<snip>

My panorama viewer applet suffers from flickering graphics as it pans
around a panoramic image - the faster it pans, the worse the flicker.
(Image quality is acceptable with slow pan speeds however).

<snip>

You don't say what component your Paint() method is in.
You don't say how you are causing the image to be redrawn.

I will guess that you are calling repaint(...). If I recall correctly,
repaint actually causes update(...) to be called. The default action for
update is to clear the drawing area, and then call paint(...).

You may need to override update to call paint directly.

... or I may be completely off base, reasoning from insufficient
information.
Source code would be nice.


--
Ian Shef 805/F6 * These are my personal opinions
Raytheon Company * and not those of my employer.
PO Box 11337 *
Tucson, AZ 85734-1337 *


Brilliant!

Yep my timer thread was calling repaint().
I had a quick Google and found an example of using the update() method.

I simply duplicated the code from my paint() method in the update() method
and gave that a try and it's perfect.
The flicker has disappeared.

I've updated the temporary webpage too - both the old (flickering) applet
and the new improved applet can both be seen in action.
http://www.warwound.dsl.pipex.com/applet/panViewer.htm

Thanks a lot - very easy and quick for me to fix it once i was pointed in
the right direction.

Martin.


.