Learning Curve Journal, Part 1: Exploring JavaFX Script
By dananourie on Aug 01, 2008
JavaFX Script is a new scripting language that developers can use to create dynamic graphical content. On the desktop, the language provides libraries to help you use the Swing user interface (UI) toolkit and Java 2D APIs conveniently. It doesn't replace either Swing or Java 2D; the goal is to make those APIs more accessible to rich content developers. In other environments, such as mobile systems, JavaFX Script makes use of user interface technologies other than Swing. JavaFX Script enables you to write visually rich applications that run across platforms and operating environments.
The language provides both declarative and procedural syntax. You can declaratively create a rich user interface, and then you can add event-handling routines and operations.
However, most of us have to start more modestly, and that's the purpose of this article. Its goal is to show you how to get started with JavaFX Script. First, you'll need the following:
- An up-to-date Java SE Development Kit (JDK)
- Access to accurate, up-to-date information
- The JavaFX Script plugin for your integrated development environment (IDE)
As a developer, you no doubt have a JDK on your system. However, if you haven't updated your system in a while, make sure you have Java SE 6. The Learning Curve Journal focuses on the compiler-based version of JavaFX Script and its support in NetBeans IDE 6.1. To install and use NetBeans IDE 6.1 with JavaFX technology, it is recommended that you install the latest level of Java SE 6 on your system, which currently is Java SE 6 Update 10 Beta. Download the latest JDK from the Java SE Downloads page of the Sun Developer Network. If you use Mac OS X, you can get Apple's latest release of the Java platform development kit, which currently is Java for Mac OS X 10.5, Update 1, directly from their Java section of the Apple Developer Connection.
When you experiment with a new environment or language, you're going to hit dead ends and difficult places. That's part of the deal we all make when we adopt leading-edge technology. However, to smooth the learning curve, good documentation and examples are absolutely critical. Along with the JavaFX Technology hub of the Sun Developer Network, the javafx.com and Project OpenJFX web sites provide demo resources and the latest documentation you need to get accurate information.
Some of you will want to start programming immediately, barely reading a word of the language reference. Others of you will read everything you can before actually using JavaFX Script. Even if you're the type that dives in right away, you have to start with some sort of language specification or tutorial. Before you can scribble out the prototypical "Hello, world" example, you need to know some basic language syntax. The documents on the JavaFX Reference page are a good place to start. You can find links there to reference documents such as the The JavaFX Script Programming Language Reference as well as links to many articles and tutorials such as Getting Started With JavaFX Technology and Creating A Simple JavaFX Application Using NetBeans IDE.
After you've read at least some of the language reference document, it's time to build a simple JavaFX application. Although you can build and run a JavaFX application manually from a command line, let's do it using NetBeans IDE 6.1, which has many features designed to simplify developing applications. You will need to install the JavaFX plugin for NetBeans.
Now Facebook users have a page to lead them to content that can help them learn Java programming. Log in to your Facebook account and Become a Fan of Get Started with Java Programming!
The New to Java Programming Center helps developers who are new to the Java platform find what they need to set up their system, understand the various technologies, and create applications for the desktop, web, and devices.