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"
}
}
}
}
Regards,
Jim Weaver
JavaFX Script: Dynamic Java Scripting for Rich Internet/Client-side Applications
Immediate eBook (PDF) download available at the book's Apress site
Hello friend
I had always wanted to learn about this topic ... I think it's great the way you expose .. great work and continuing on with this great blog
Derek Sheridan
Posted by: generic viagra | May 14, 2010 at 11:10 AM
Terra,
There was a misprint in the article: Here is the correct code. The article will be correct 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"
}
}
}
}
Posted by: Jim Weaver | February 01, 2008 at 08:50 AM
My apologies. I shouldn't be bothering you with the JavaFX compiler's problem. I posted the same question on OpenJFX forum. I can hardly wait for the JavaFX compiler available. Thanks a lot.
Posted by: Terra (Hisao Terasawa) | February 01, 2008 at 02:53 AM
I wasted little time in doing the tutorial. But, I couldn't compile the Code Sample 1 in that article(:_;)
The JavaFX compiler, which I obtained as following the direction of the tutorial, output same messages "line 56:0 rule RBRACE failed predicate: { !BraceQuoteTracker.rightBraceLikeQuote(CUR_QUOTE_CTX) }?" infinitely.
My Java version is jdk1.5.0_11. If you know the cause, please help me. I was looking forward eagerly to use JavaFX Compiler.
Posted by: Terra (Hisao Terasawa) | January 31, 2008 at 11:47 PM