devxlogo

How to Remove Flashing in an Applet

How to Remove Flashing in an Applet

Most of the Java books talk about double buffering for removing theflashing. It solves the problem to some extent but not 100% perfect in caseof flashing. I am giving the following tricks to solve the flashing problemin animation :

1) Use Media Tracker for downloading the images.
2) Use double buffering.
3) Change the default background color of the applet to the color ofyou Canvas by using setBackground(Color of the Canvas) in the init method ofthe applet.
4) In an animation if you are updating only part of a area userepaint(x1,y2,x2,y2) instead of repaint().

devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist