2/9/09 4:50 PMavaFX Tutorial | Get Started with JavaFX Script for Web Application Design | Java FXPage 1 of 6
http://java.sun.com/javafx/1/tutorials/core/getStarted/Feb 09, 2009
Learning the JavaFX Script Programming Language
Lesson 1: Getting Started with JavaFX Script
Ready to explore the JavaFX Script programming language? Great! This lesson describes the software that must be installed on your system before you can begin. It also provides NetBeans IDE and command line instructions for compiling and running your firstapplication.
-Step 1: Download and install the JDK-Step 2: Choose a Development Environment-Step 3 : Download and Install the JavaFX Compiler and Runtime
Step 1: Download and Install the JDK
The JavaFX Script programming language is based on the Java Platform, and as such, requires JDK 5 or JDK 6 (6 is faster) to be installedon your system. If you have not done so already,download and install JDK 6or JDK 5now, before proceeding with this tutorial.
Step 2: Choose a Development Environment
When it comes to choosing a development environment, you have two broad categories of choices: use an Integrated DevelopmentEnvironment (IDE), or use a plain text editor. This choice is entirely a matter of personal taste, but the following summary might help you tomake an informed decision.Generally speaking:An IDE provides a complete development environment all in one place. You download one piece of software, or perhaps a
tothat software, which provides everything you need to compile/run/debug your application. IDEs present the most commonly usedfunctions as Graphical User Interface (GUI) elements, and offer many useful features, such as automatic code completion and customsource code views. An IDE also gives you immediate feedback on errors and highlights code so that it is easier to understand. Theofficially supported IDE for the JavaFX Script programming language isNetBeans IDE 6.5. The NetBeans IDE website providesinstructions for downloading, installing, and configuring the IDE.A text editor provides simplicity and familiarity. Experienced programmers often rely on their text editor of choice, preferring to work inthat environment whenever possible (some editors, like
, have a rich set of built-in keystroke commands that some programmerssimply cannot live without!) If you already have a preferred editor, rest assured that you can download the sample code for eachlesson as
source files for use in your editor of choice.
Step 3: Download and Install the JavaFX Compiler and Runtime
The JavaFX Script programming language is a
language, which means that any source code you write must first be convertedinto Java bytecode — the language of the Java Virtual Machine — before it can run on your system. This is true regardless of your development environment (be it command line or IDE). After installing the JDK and choosing a development environment, you will need todownload and install the JavaFX Script compiler and runtime. The easiest way to obtain this software is to download the entireJavaFXSDK, which gives you the NetBeans IDE (optional), compiler, runtime, and a number of other tools.Another way is to simplydownload the latest compiler binaryfrom the openjfx project website. The compiler itself is written in the Javaprogramming language; installing the precompiled binary therefore becomes a matter of extracting the downloaded file and adding the
tools to your path. The complete set of instructions for this approach can be found on thePlanetJFX Wiki.Finally — if you want to live on the bleeding edge — you can join theOpenJFX Compiler Project, create your own copy of the compiler workspace, and build everything yourself from the compiler source files. (If you choose this approach, you will also need the 1.7.0 versionof Apache Ant, plus a recent copy of Mercurial).