JavaFX 1.0: Get Started

The few steps it took me to get started with JavaFX. I am using Netbeans 6.5, so the only thing to do is to select the plugins under Tools and reload the catalog for available plugins. Search for “javafx” and install the 4 plugins/packages.


Install JavaFX Plugins

You might run into this network related problem. It can be annoying because you eventually have to start the 45MB download again (and again), but that applies to all plugins.
Not all of the plugins have been successfully donwloaded..


Network Problem

After downloading and restarting the IDE you find 2 new sections in the “new peoject” screen. One for a skeleton JavaFX application and under samples a rather big number of preloaded samples to get you running.

Choosing a new JavaFX application:

New JavaFX Project

New JavaFX Project

Lets call it MyGreatFXApplication:

Application Settings

Application Settings

and there we go, Netbeans created a basic skeleton and opens the sourcecode for us, which looks like a mixture of some script and Javacode.

package mygreatjavafxapplication;

import javafx.stage.Stage;
import javafx.scene.Scene;
import javafx.scene.text.Text;
import javafx.scene.text.Font;

Stage {
title: “Application title”
width: 250
height: 80
scene: Scene {
content: Text {
font : Font {
size : 24
x: 10, y: 30
content: “Application content”

Hit run and you see most basic windows with “application content”. Please note the great live preview function (ALT+SHIFT+P) which shows the changes while you editing the code (here a second screen or one big screen comes handy!).

Running Skeleton Application

Running Skeleton Application

To be continued with more serious samples..

2 thoughts on “JavaFX 1.0: Get Started

  1. Pingback: Starting with JavaFX « The JavaDude Weblog

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s