Hello World!

After ZK is installed into your favorite Web server[8], writing applications is straight forward. Just create a file, say hello.zul, as follows[9] under a proper directory.

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

Then, browse to the right URL, say http://localhost/myapp/hello.zul, and you got it.

In a ZUML page, a XML element describes what component to create. In this example, it is a window (org.zkoss.zul.Window). The XML attributes are used to assign values to properties of the window component. In this example, it creates a window with a title and border, which is done by setting the title and border properties to "Hello" and "normal", respectively.

The text enclosed in the XML elements is also interpreted as a special component called label (org.zkoss.zul.Label). Thus, the above example is equivalent to the following.

<window title="Hello" border="normal">
    <label value="Hello World!"/>    
</window>

Also, it is equivalent to

<window title="Hello" border="normal">
    <label>Hello World!"</label>    
</window>


[8] Refer to the Quick Start Guide.

[9] The other way to try examples depicted here is to use the live demo to run them.