Applets have default attributes associated with them. Special attributes like image and boxmessage can be associated with applets and used for customizing the applet window during downloading of an applet. JavaBeans component can also be customized using these special attributes. This section discusses the following :
The default appearence of an Applet when no special attributes are used is as follows:
image attribute allows you to replace the
default animation with a custom graphic. The format with the
APPLET element is:
<PARAM name="image" value="my_image.gif">
APPLET Tags in Java Plug-in
for how this would be mapped to the
OBJECT or the
If a custom graphic is specified, it should be the same size as
the area of the applet window. If these sizes do not match, the
graphic will be placed in the upper left corner of the area
specified for applet. If it is larger than the applet window, part
of it will get chopped off. If it is smaller than the applet
window, white, or whatever color is specified for
boxbgcolor, will appear around it.
The image can be either a GIF or JPEG, and it should reside in
the same directory where other resources for the applet reside;
i.e., if the applet uses the
codebase attribute, then
this image should be in the
Note: The image file should not be in a packaged jar file with other applet resources, since the image needs to be displayed while downloading resources.
The status bar of the browser will display "
Applet ..." when the mouse is pointed at the applet
boxmessage attribute you can customize the
text displayed in the status bar of the browser. This attribute
will be in effect when
image attribute is used. The
format for using this with the standard
<PARAM name="boxmessage" value="<your custom message goes here>">
These attributes can be used to customize colors in the applet window.
These attributes will be in effect when the
attribute is used. Custom colors cannot be specified for the
default appearance of the applet viewing area.
By default the applet window background color is white. The
boxbgcolor can be used to specify a
different background color. The format for use with the standard
APPLET element is:
<PARAM name="boxbgcolor" value="<value>">
<value> may be:
bare integers in the range of
0-255that would render an opaque standard RGB (sRGB) color in the
Color(int r, int g, int b);
Examples of each item above:
By default the applet window foreground color is black. The
boxfgcolor can be used to specify a
different foreground color. The color values are the same as
described above. The format for use with the standard
APPLET element is:
<PARAM name="boxfgcolor" value="<value>">
When the applet classloader needs to load a class or resource
(for example, configuration files for pluggable service providers
META-INF/services directory), it first
searches for the required files in the applet JAR files and then
from the applet codebase. Typically applets are deployed with all
the needed classes and resources stored in the applet JAR files. In
this case, the codebase lookup is unnecessary.
If the class or resource is not available from the applet JAR files, it may be better to have the classloader fail rather than attempt a codebase lookup. Otherwise, a connection has to be made to the applet codebase to search for the class or resource, and it may have performance impact on the applet runtime.
<PARAM name="codebase_lookup" value="false">
The order of precedence for these attributes in applets is as follows:
1) If no parameters are provided, the default
appearance described above is used.
2) If a custom graphic is specified via the
attribute, then the custom graphic will appear as described above
3) If custom text is provided via the
attribute, then custom text will be displayed as described above
With any combination of
boxmessage attributes, custom colors can always be
provided via the
If an applet fails to load the following actions are performed:
The user can click in the applet window to get a popup menu to open one of the following options:
Copyright © 1993, 2011, Oracle and/or its affiliates. All rights reserved.