Generally double buffering is used for removing the flashing. But is does not solves the problem 100%. Following tricks can be used to solve the flashing problem in animation.
1.Use Media Tracker for downloading the images.
2.Use double buffering.
3.Change the default background colour of the applet to the colour of you Canvas by using setBackground(Colour of the Canvas) in the init method of the applet.
4.In an animation if you are updating only part of a area use repaint(x1,y2,x2,y2) instead of repaint().
source: java-tips.org
Wednesday, March 25, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment