IconLabel DTD and XML definitions

The IconLabel has the same attributes as the Label, except that instead of label text it has an iconName attribute for specifying the location of the icon. The IconLabel has the following entry in the DTD file:
Table 1. IconLabel definition
Line entry in the DTD file Description
<!ELEMENT IconLabel EMPTY> An IconLabel does not contain any sub-elements
<!ATTLIST IconLabel
    iconName CDATA #REQUIRED
    name CDATA #IMPLIED
    width CDATA "32"
    height CDATA "22"
    x CDATA #REQUIRED
    y CDATA #REQUIRED
    onClick CDATA #IMPLIED
    onMouseEntered CDATA #IMPLIED
    onMouseExited CDATA #IMPLIED
    onInitialize CDATA #IMPLIED>
Attribute list
Table 2. IconLabel attributes
Attribute Description
iconName Name of the file containing an icon to be set into the label (mandatory)
name Name used by the Desktop to identify this component. Applications can have access to this object at runtime by requesting it by name from the Desktop.
width Width of the label
height Height of the label
x Horizontal coordinate for the location of the label (mandatory)
y Vertical coordinate for the location of the label (mandatory)
onClick Java(TM) code to be executed when the label is clicked
onMouseEntered Java code to be executed when the mouse cursor is placed over the label
onMouseExited Java code to be executed when the mouse cursor is moved away from the label
onInitialize Java code to be executed when the component is initialized
The following is an example of an XML definition for an IconLabel:
<IconLabel width="34" height="31" x="185" 
   y="47" iconName="/bankicon.gif" />