Hello world!
By this simple two words, programming languages are usually introduced with a simple program that prints "Hello world!".
I will show you how to display this message using a simple XGL component that will show "Hello world!" in the top right corner.
First in HTML/JavaScript:
<html> <head> <script type="text/javascript" language="javascript" src="xgljs.lib/xgljs.lib.nocache.js"></script> </head> <body> <script> function main() { xgl.Toast.toast("Hello world!"); } </script> </body> </html>
And now in Java:
package com.xalys.xgl.demo.helloworld; import com.google.gwt.core.client.EntryPoint; import com.xalys.xgl.Toast; public class HelloWorld implements EntryPoint { @Override public void onModuleLoad() { Toast.toast("Hello world!"); } }