If you'd like to learn to develop programs in compiled JavaFX Script, there is a new resource available. It is an 18 part tutorial-style series entitled Creating Rich Internet Applications With Compiled JavaFX Script Technology, and is available on the java.sun.com home page. This series will unfold over the next six months, so now is a great time to get started on the first lesson!
Important Note: There is currently a misprint in the code example in that article. Here is the correct code, and the article will be corrected shortly:
/*
* HelloCompiledJavaFX.fx - A "Hello World" style, but slightly more
* sophisticated, compiled JavaFX Script example
*
* Developed 2008 by James L. Weaver (jim.weaver at lat-inc.com)
* to serve as a compiled JavaFX Script example.
*/
package mypackage;
import javafx.ui.*;
import javafx.ui.canvas.*;
Frame {
title: "Hello Rich Internet Applications!"
width: 550
height: 200
background: Color.WHITE
visible: true
content:
BorderPanel {
top:
FlowPanel {
content:
Button {
text: "Click Me"
action:
function():Void {
MessageDialog {
title: "JavaFX Script Rocks!"
// This string has a newline in the source code
message: "JavaFX Script is Simple, Elegant,
and Leverages the Power of Java"
visible: true
}
}
}
}
center:
Canvas {
content:
Text {
font:
Font {
faceName: "Sans Serif"
style: FontStyle.BOLD
size: 24
}
x: 20
y: 40
stroke: Color.BLUE
fill: Color.BLUE
content: "JavaFX Script Makes RIA Development Easy"
}
}
}
}
0 comments:
Post a Comment