Getting started with JavaFX (in 30 minutes)
Saturday, June 27, 2009 at 09:23AM After hearing a lot of buzz about JavaFX, (and the upcoming "designer tool" demoed at Java One, scheduled for Q3/Q4), I decided to get my hands dirty with JavaFX. This is not a tutorial on JavaFX but rather references, and a summary of the experience of getting started.
What is JavaFX?
According to the "all knowing Wikipedia"; "JavaFX is a software platform for creating and delivering rich Internet applications that can run across wide variety of connected devices. The current release (JavaFX 1.2, June 2009) enables building applications for desktop, browser and mobile phones. TV set-top boxes, gaming consoles, Blu-ray players and other platforms are planned."
JavaFX is not an API for GUI development, but rather a platform that uses a declarative programming language called JavaFX Script.
To have a quick view of the possibilities, take a look at the samples on javafx.com
Getting started with Eclipse
Sun has a "getting started" tutorial that looks okay over at javafx.com. It's worth noticing that there s no mention of how to get started with Eclipse (of course). I've heard a lot of praise of Netbeans lately, but learning something new, and a new IDE at the same time is not what I wanted.
I started my adventure and downloaded the 45 MB JavaFX SDK, at the same time updating my Eclipse 3.5 with a JavaFX Feature. This feature will among other things enable you to create a new "JavaFX Project from the "new Project" menu.
... A Small problem, my bad
A minor setback occurred during my first attempt to create a JavaFX project from the "new project" menu. I got the error message;”The JavaFX SDK location was not specified". This is because I am impatient, and installed the JavaFX plug-in before the JavaFX SDK. If this happens, it's just a matter of selecting the window/preferences dialog and select "class path variables" under "build path". There should be a JAVAFX_HOME class path variable pointing to the directory where the JavaFX SDK was installed.
And the first project
Creating a JavaFX project is easy. Just select create new project from the menu, and select "JavaFX Project". After that you can create new Java FX scripts, either empty, or have some example "hello world" like scripts to start playing with.
Conclusion
I was happy to see that JavaFX works with the latest eclipse. The only hiccup was a fault of my own. It's very easy to get started with JavaFX development, probably easier with Netbeans, as you can download both the IDE and SDK as a bundle. I was definitely up and running with the platform in under 30 minutes.
References
- Wikipedia http://en.wikipedia.org/wiki/Javafx
- Sun's getting started page http://javafx.com/docs/gettingstarted/javafx/
- JavaFX SDK download page http://java.sun.com/javafx/downloads/
- JavaFX Plugin for Eclipse http://javafx.com/downloads/eclipse-plugin
- Samples and example apps http://www.javafx.com/samples/
Glenn Bech |
2 Comments |
clas 