How to change an applet background color?

Applet’s default background color is Grey. If you want to change it then you need to call the setBackground(java.awt.Color) and choose the color you want. Defining the background color in the init method will change the color as soon as the applet initialized.

Read More

Java Code Example for Applet: getDocumentBase() Method

Java Code Example for Applet: getDocumentBase() Method

getDocumentBase() emthod of Applet class returns the URL of the document in which this applet is embedded. For example, suppose an applet is contained within the document: C:/Vigilance/samples/bin/index.html Then the document base is : C:/Vigilance/samples/bin/index.html Below java code show how to get the document base in Applet : /********************************************************************************** * Created on Nov, 2004 Copyright(c) …

Read More

Java Code Example for Java Applet

An applet is a small program that is intended not to be run on its own, but rather to be embedded inside another application. The Applet class must be the superclass of any applet that is to be embedded in a Web page or viewed by the Java Applet Viewer. The Applet class provides a …

Read More