Login | Register   
RSS Feed
Download our iPhone app
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.

Tip of the Day
Language: Visual Basic
Expertise: Beginner
Sep 15, 2000



Building the Right Environment to Support AI, Machine Learning and Deep Learning

How to Remove Flashing in an Applet

Most of the Java books talk about double buffering for removing the flashing. It solves the problem to some extent but not 100% perfect in case of flashing. I am giving the following tricks to solve the flashing problem in 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 of you Canvas by using setBackground(Color 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().
Harvinder Singh,
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



Thanks for your registration, follow us on our social networks to keep up-to-date