Archive for the ‘javafx’ tag
“Hello World” (GUI) example in JavaFX
package tutorial;
import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.scene.text.Text;
import javafx.scene.text.Font;
import javafx.scene.text.FontWeight;
def WIDTH = 160;
def HEIGHT = 80;
def MESSAGE = "Hello World!";
Stage {
title: MESSAGE
width: WIDTH
height: HEIGHT
scene: Scene {
fill: Color.BLACK
content:
Text {
font: Font.font("Serif", FontWeight.BOLD, 16)
fill: Color.WHITE
x: 10
y: 30
content: MESSAGE
}
}
}
Command line “Hello World!” in JavaFX
Download JavaFX SDK. Install it, and have its bin folder in your PATH.
Open your favorite text editor, and write:
println("Hello World!");
java.lang.System.exit(0);
Save the file as A.fx. To compile the code:
$ javafxc A.fx
This will generate the class file A.class. To run the application:
$ javafx A
Isn’t it simple?
JavaFX 1.2 for Linux, Mac and Solaris
JavaFX is now available for Linux, Solaris and Mac. Finally, now I can try this technology (I use Linux at work and home)!
JFXBuilder: JavaFX Visual Design Tool
The first design tool for JavaFX is available here: http://www.reportmill.com/jfx/. The product page does not discuss any licensing or pricing detail. The current version is available as WebStart application for free use.
JavaFX 1.0 Released
Get it! But if you are an unfortunate Linux user like me, it is not yet available for our platform