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: Java
Expertise: Intermediate
Jan 12, 2000



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

Change the Gray Applet Background

Applets use a default background of gray, which may not be visually appealing to you. Besides, gray may be the background color of the web page on which the applet is loaded.

One way to change the applet's background is to repaint the background in the paint() method of the applet. But, if you wanted to change the applet's background as soon as the applet loads, the best place would be in the init() method, and the applet will change color once it's loaded, as in the following:

public void init() 
setBackground ( Color.black ); 
//rest of the init() code 
Behrouz Fallahi
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