If memory serves me correctly, when a component is painted, paint() is sometimes called, but update() is always called. And the default implementation of update() clears the component - which causes the flickering.
Therefore it''s slightly more efficient for paint to call update and for update to do the painting.
[java] Double buffering in applets
Ignore that last post. I was talking bollocks.
update() is not always called. paint() is usually called when part of a component is uncovered (update is not called in this case apparently)
I still think update is called more often than paint - I seem to recall reading that somewhere - so the efficiency argument is still true.
update() is not always called. paint() is usually called when part of a component is uncovered (update is not called in this case apparently)
I still think update is called more often than paint - I seem to recall reading that somewhere - so the efficiency argument is still true.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement