Hello world!

A beautiful components library for GWT and JavaScript

Hello world!

May 3, 2018 Uncategorized 0

 

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!");
  }
}

 



Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.