window

Description

The window tag describes a window in an application. In Java, this maps to a subclass of JFrame. This subclass has a static (class) method getSingleton(), which returns the unique instance of this class. The window tag contains the elements that are in the window. These elements translate to Swing components. For each component, there is a private variable in the JFrame subclass referencing it (see id attribute). All components except menus and popup menus are contained by a special JPanel named contentpane.

Attributes

    guiversion (required)
    id (required)
    image
    layout (horizontal)
    layoutalign (begin)
    mainwindow (false)
    oncreate (false)
    ondestroy (false)
    onhide (false)
    onshow (false)
    resizable (true)
    text (required)
    visible (false)

Children

button checkbox image input

list menubar panel popupmenu

progressbar radiogroup scale statictext

Description of attributes

guiversion

This attribute specifies the version of PLUG used. This option is required.

image

The value of this attribute specifies a source file for the frame's icon. This icon is set by the setIconImage() method of JFrame.

layout

This attribute is used for indicating the layout of the window. The possible values are horizontal, vertical and border. The default value is horizontal. See layout for more information about the layout issues.

layoutalign

This attribute is used for indicating the alignment of elements in the window when the window has the vertical or horizontal layout. The possible values are begin, middle and end. The default value is begin. See layout for more information about the layout issues.

mainwindow

This attribute determines whether this window is the mainwindow. Only one mainwindow is allowed in an application. The mainwindow is the first window to display. The values that are allowed for this attribute are true and false. The default value is false.

onhide

The onhide attribute of window determines whether there is an onhide event for this window. A PLUG onhide event maps to a windowClosing event in Java, which occurs when a user tries to close a window. The event listener is responsible for actually closing or hiding the window (with myWindow.dispose() or myWindow.hide(), resp.). When the onhide attribute has the value true, an entry, for handling this event, will be created in the code-frame for this window. When it has the value false, an event listener will be registered which disposes the window.

onshow

The onshow attribute of window determines whether there is an onshow event for this window. An onshow event occurs when the window first appears on the screen. When the onshow attribute has the value true, an entry, for handling the onshow event, will be created in the code-frame for this window.

resizable

The resizable attribute of the window tag indicates whether the window is resizable. It can take the boolean values true and false. The default value is true.

text

Specifies text to be displayed in the title-bar of the window when any.

visible

Specifies whether the window is visible or not. The allowed values for this attribute are true and false. The default value is false.