next up previous contents index
Next: Compiling DJ programs Up: Getting Started Previous: Structure of DJ

A simple example

Let us consider the following example:

       main class HelloWorld {
            component Button bt{text=="Hello World!"}; 
       }
This program has only one component declaration which declares that the panel has a button named bt and the text on the button is "Hello World!". The statement in the brackets after bt is called a constraint that constrains the value of the text attribute of bt. Nothing is said about the color and size of the button, the font of the text, and the position of the button in the panel. we can but do not have to give the values to these attributes. The system will determine the attribute values for us either by using the constraints we provided or by using the default values.    



Neng-Fa ZHOU
Sat Apr 18 16:14:29 JST 1998