Wednesday, May 14, 2008

JavaFX Ep2 : "Hello World"

Say "Hello World"
New Project> JavaFx> JavaFx Script Application












Let's start like instructed by trying to run the Hello World example featured on the JavaFX tutorial page.

import javafx.ui.*;

Frame {
title: "Hello World JavaFX"
width: 250
height: 50
content: Label {
text: "Hello World. From Javalobby!"
}
visible: true
}

























This code uses the declarative source code "annotation", it is also possible to use the procedural source code "annotation".

  var win = new Frame();
win.title = "Hello World JavaFX";
win.width = 250;
win.height = 50;
var label = new Label();
label.text = "Hello World. From Javalobby!";
win.content = label;
win.visible = true;

No comments: