Re: Double buffer help
- From: Ian Shef <invalid@xxxxxxxxxxxxx>
- Date: Wed, 05 Apr 2006 19:35:16 GMT
"Martin" <zedolf@xxxxxxxx> wrote in news:c9adncRoxOlOOazZRVnyiA@xxxxxxxxx:
Brilliant!
No, but thanks.
Yep my timer thread was calling repaint().
I had a quick Google and found an example of using the update() method.
An excellent resource for painting issues is
"Painting in AWT and Swing":
http://java.sun.com/products/jfc/tsc/articles/painting/index.html
Nooooooooooooo !!
I simply duplicated the code from my paint() method in the update()
method and gave that a try and it's perfect.
You are setting yourself up for a maintenance and debug nightmare.
Provide the code in only ONE place!
Either:
1) Locate the code in paint(), and have update() call paint(), OR
2) Locate the code in update(), and have paint() call update(), OR
3) Locate the code in a new method, and have both paint() and update(0
call the new method.
The flicker has disappeared.
Glad to hear it.
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
Nice contrast between the two cases. Thanks, I rarely get to see such a
visible result of my advice.
Happy to have helped.
Thanks a lot - very easy and quick for me to fix it once i was pointed
in the right direction.
Martin.
-- Ian
--
Ian Shef 805/F6 * These are my personal opinions
Raytheon Company * and not those of my employer.
PO Box 11337 *
Tucson, AZ 85734-1337 *
.
- Follow-Ups:
- Re: Double buffer help
- From: Martin
- Re: Double buffer help
- References:
- Double buffer help
- From: Martin
- Re: Double buffer help
- From: Martin
- Re: Double buffer help
- From: Ian Shef
- Re: Double buffer help
- From: Martin
- Double buffer help
- Prev by Date: Re: Calendar event applette
- Next by Date: Re: integers and arrays in Java - how?
- Previous by thread: Re: Double buffer help
- Next by thread: Re: Double buffer help
- Index(es):
Relevant Pages
|
|