IT. Expert System.

Java Standard Edition (SE)

Special Applet Attributes

Special Applet Attributes

Java Rich Internet Applications Guide > Enhancements and Other Features > Special Applet Attributes

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.

The following topics are covered:

Default Appearance of Applets

The default appearence of a Applet when no special attributes are used is as follows:

  • The Java logo is centered in the applet's space.
  • There is a white glow (circle with hazy edge) encircling the Java brand.
  • The rotating burst animation shows that activity is occuring.
  • The progress bar is located below the bottom edge of the Java brand graphic to show the progress as the applet is downloaded.
  • Depending on the size of the applet's viewing area the default appearance will vary.
  • The design of animation will scale to accomodate different "width-by-height" combinations.
  • When the mouse is moved over the applet's area during the loading period, the cursor changes to the normal hypertext cursor indicating that this element is an interactive part of the web page.
  • Clicking/selecting anywhere within the Gray Box will spawn a new browser window pointing to the web page.

Special Attributes of Applets


The image attribute allows you to replace the default animation with a custom graphic. The format with the standard applet element is:

<applet ...>
<param name="image" value="my_image.gif">

See Using applet, object and embed Tags in Java Plug-in for how this would be mapped to the object or the embed tags.

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 codebase directory.

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 "Loading Java Applet ..." when the mouse is pointed at the applet window.


With the 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 APPLET element is:

<APPLET ...>
<PARAM name="boxmessage" value="<your custom message goes here>">

boxbgcolor, boxfgcolor

These attributes can be used to customize colors in the applet window.

These attributes will be in effect when the image 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 attribute boxbgcolor can be used to specify a different background color. The format for use with the standard APPLET element is:

<APPLET ...>
<PARAM name="boxbgcolor" value="<value>">

where <value> may be:

  • any Color from java.awt.Color;
  • r,g,b where r, g, and b are integers in the range of 0-255 that would render an opaque standard RGB (sRGB) color in the Color constructor Color(int r, int g, int b);
  • standard HTML colors: silver, green, maroon, purple, navy, teal, and olive; or
  • hexadecimal color format

Examples of each item above: value="cyan", value="111,222,145", value="silver", value="#33FF33"

By default the applet window foreground color is black. The attribute 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:

<APPLET ...>
<PARAM name="boxfgcolor" value="<value>">

Applet Attribute Precedence

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 image attribute, then the custom graphic will appear as described above under image.
3) If custom text is provided via the boxmessage attribute, then custom text will be displayed as described above under boxmessage.

With any combination of image and boxmessage attributes, custom colors can always be provided via the boxbgcolor and boxfgcolor attributes.

Troubleshooting Scenario

If an applet fails to load the following actions are performed:

  • The applet window displays error information.
  • The applet window has a single pixel border using white for the foreground color, and a small "broken" graphic will occupy the upper left corner.

The user can click in the applet window to get a popup menu to open one of the following options:

  • Open the Java Console
  • Open a window with information about the Java VM and Java Plug-in.


Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)





Java Script








Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 85 / 158796323. Delta: 0.06404 с