Label

A label component represents a piece of text.

<window border="normal">
    Hello World    
</window>

If you want to specify attribute to a label, you have to specify <label> explicitly as follows.

<window border="normal">
    <label style="color: red" value="Hello World"/>    
</window>

Tip: ZUML is XML, not HTML, so it doesn't accept &nbsp;. However, you can use &#160; instead.

The pre, hyphen, maxlength and multiline Properties

You can control how a label is displayed with the pre, hyphen , and maxlength Properties. For example, if you specify pre to be true, all white spaces, such as new line, space and tab, are preserved.

hyphen

pre

maxlenth

Description

false

false

positive

Truncated the characters that exceeds the specified maxlength.

true

any

positive

If the length of a line exceeds maxlength, the line is hyphenated.

false

true

any

maxlength is ignored.

any

any

0

pyphen is ignored.

<window border="normal" width="100px">
<vbox id="result">
</vbox>
    <zscript><![CDATA[    
    String[] s = {"this is 9", "this is ten more to show",    
    "this framework", "performance is everything"};    
    for (int j = 0; j < s.length; ++j) {    
        Label l = new Label(s[j]);        
        l.maxlength = 9;        
        l.hyphen = true;        
        l.parent = result;        
    }    
    ]]></zscript>    
</window>

The multiline property is similar to the pre property, except it preserves only the new lines and the white spaces at the beginning of each line.