Common Options

This section describes the attributes that most of the elements have in common.

Attributes

    backgroundcolor
    fontbold
    fontitalic
    fontname
    fontsize
    fontunderline (not available)
    foregroundcolor
    id (required)
    oncreate (false)
    ondestroy (false)
    popup
    position (center)
    state (enabled)

Description of attributes

backgroundcolor

The backgroundcolor option contains the color that is used as the backgroundcolor of the element. Currently supported colors are: black, white, green, red, yellow, blue, gray, magenta, cyan and brown. The backgroundcolor attribute is set by the setBackground() method of the component.

fontbold

This attribute indicates whether the font of the element must be bold. Allowed values are true and false. The font is set by the setFont() method of the component.

fontitalic

This attribute indicates whether the font of the element must be italic. Allowed values are true and false. The font is set by the setFont() method of the component.

fontname

The fontname specifies the name of the font that has to be used for the text in the element. Due to the differences in fonts on the platforms we only distinct between serif, sansserif and monospace, which are mapped to Java logical font names Serif, SansSerif and Monospaced. The font is set by the setFont() method of the component.

fontsize

The fontsize indicates the size of the font in points that is used for the text of the element. The font is set by the setFont() method of the component.

fontunderline

The fontunderline indicates whether the text of the element should be underlined. Allowed values are the booleans true and false. This attribute is not supported by Swing.

foregroundcolor

The foregroundcolor option contains the color that is used as the foregroundcolor of the element. Currently supported colors are: black, white, green, red, yellow, blue, gray, magenta, cyan and brown. The backgroundcolor attribute is set by the setForeground() method of the component.

id

The id attribute specifies the unique id of the object. The id attribute is required. The value of the id attribute should consist of lowercase characters. The attribute id of the window and application tag is used as class name and should match the file names without the ".xml" extension. For other elements the id attribute is used as the name of the variable which references the component. This private variable is defined in the JFrame subclass (see window), so all event-handling methods are in the scope of all component variables.

oncreate

If this attribute has the value true then a section for the event code will be created in the codeframework of the window this element is in. The code typed in this section is inserted in the source code file right after the component is created and all attributes are set. Allowed values for this attribute are true and false.

ondestroy

This attribute is not supported in PLUG for Java/Swing.

popup

The popup attribute refers to an existing popup menu that is used as popup menu for the element. The value of this attribute is the value of the id attribute of the popupmenu. A PopupListener object (subclass of MouseListener) is created and registered with the component. If a mouse event occurs which is a popup trigger (i.e. its method isPopupTrigger() returns true), the show() method of the referenced popup menu is invoked.

position

The position attribute is used to specify the position of the element when the layout style of the parent is the borderlayout. It can have the following values: left, right, top, bottom and center. The default value is center. The position attribute is ignored when the element's parent doesn't have a border layout. For more information on the layout click here.

state

The state attribute indicates whether the element is enabled or disabled in the gui. The default value is enabled. The state is set by the setEnabled() method of the component.