Installing JavaFX Scene Builder

JavaFX Scene Builder is a design tool that enables you to drag and drop graphical user interface (GUI) components onto a JavaFX scene. It can help you to quickly prototype interactive applications that connect GUI components to the application logic. It automatically generates the FXML source code as you define the GUI layout for your application. This guide provide instructions for installing JavaFX Scene Builder 1.0 on a 32-bit or 64-bit Windows system, or a Mac OS X system.

System Requirements

Ensure that your system meets the following minimum requirement before you install the JavaFX Scene Builder product.

  • JavaFX 2.2.x software for your platform. Use the latest JavaFX 2.2.x System Requirements document and Installation Guide at http://docs.oracle.com/javafx/release-documentation.html to obtain specific information regarding supported operating systems, browsers, Java platform, and installation instructions.

To successfully complete the JavaFX Scene Builder Getting Started tutorial, it is highly recommended that you also install the following software:

  • NetBeans IDE 7.2 software to utilize the tight integration with JavaFX Scene Builder to create a new FXML file, edit it using JavaFX Scene Builder, modify your Java controller source files, compile them, and run the sample application used in the tutorial. Download the NetBeans IDE 7.2 software from http://netbeans.org/downloads/index.html. For information about configuring NetBeans IDE to run with a specific JavaFX version, see Setting Up NetBeans IDE with JavaFX at http://netbeans.org/kb/docs/java/javafx-setup.html

There are also instructions in the JavaFX Scene Builder Getting Started that guide you to complete the tutorial using JavaFX Scene Builder only.

Ensure that the installed components are compatible with one another. For example, on the Windows platform, if you install the 32-bit version of the JDK 7, then you must install the 32-bit version of the JavaFX Scene Builder, as shown in Table 1.

Table 1 List of Compatible Installed Software Products on a Windows Platform


Software for 32-Bit Windows systems
Software for 64-Bit Windows System

JavaFX Scene Builder 1.0 for a 32-bit Windows system

JavaFX Scene Builder 1.0 for a 64-bit Windows system

Minimum supported version of JDK 7 update 6 software with JavaFX 2.2 support for a 32-bit system

Minimum supported version of JDK 7 update 6 software with JavaFX 2.2 support for a 64-bit system


Installation

The JavaFX Scene Builder is available as an .msi file for the Windows platform and as a .dmg file for the Mac OS X platform.

To install: 

  1. Go to the JavaFX Scene Builder section of the JavaFX General Availability Download page at http://www.oracle.com/technetwork/java/javafx/downloads/index.html.

  2. Locate the JavaFX Scene Builder 1.0 section, click the link for your operating system, and follow the prompts to save the installer file.

  3. (Windows platform) Run the javafx_scenebuilder-1_0-windows-<platform>.msi installer file, where <platform> is either x64 or i586. Respond to the prompts as indicated in the installation wizard.

    By default, the JavaFX Scene Builder software is installed at C:\Program Files\Oracle\JavaFX Scene Builder 1.0 on a Windows platform. If you install a 32-bit version of the JavaFX Scene Builder on a 64-bit Windows machine, the default installation location is C:\Program Files (x86)\Oracle\JavaFX Scene Builder 1.0.

    (Mac OS X platform) Open the javafx_scenebuilder-1_0-macosx-universal.dmg file and drag the JavaFX Scene Builder 1.0.app application into the Applications folder.

    For either platform, the installed software contains the files similar to what is shown in Figure 1, which shows the installation on a Windows platform.

    Figure 1 Contents of a JavaFX Scene Builder 1.0 Installation on a Windows Platform

    Description of Figure 1 follows
    Description of "Figure 1 Contents of a JavaFX Scene Builder 1.0 Installation on a Windows Platform"

    /bin - Contains the JavaFX Scene Builder executables, properties file, and libraries.

    /lib - Contains a copy of the JavaFX Runtime executables and libraries that enable JavaFX Scene Builder to run standalone.

    COPYRIGHT.html - Contains the copyright information for JavaFX Scene Builder.

    README.html - Contains a pointer to the JavaFX Scene Builder README page.

    THIRDPARTYLICENSEREADME.txt - Contains the list of third-party licenses.

Getting Started

To get started with JavaFX Scene Builder, read through the following JavaFX Scene Builder documentation that can be found at http://docs.oracle.com/javafx/.

You can also view the JavaFX Scene Builder 1.0 with NetBeans 7.2 video tutorial, which shows similar steps to create the same FXML file for the simple issue tracking application that is built using the Getting Started tutorial.

Running the JavaFX Scene Builder Samples

Download the JavaFX Scene Builder samples to see some applications you can build using JavaFX Scene Builder. Each sample is a NetBeans project and also includes at least one JavaFX layout stored as an FXML file. The <sample>.fxml file can be loaded and edited using the JavaFX Scene Builder.

To run the samples, you must have the JDK 7 software with JavaFX 2.2 support or JDK 6 plus JavaFX 2.2 installed on your system. You can use either the NetBeans IDE or the Ant utility to run the samples.

Using NetBeans IDE

Use NetBeans 7.2 or later to run the JavaFX Scene Builder samples.

  1. Go to the JavaFX Scene Builder Samples section of the download page at http://www.oracle.com/technetwork/java/javafx/downloads/index.html

  2. Locate the JavaFX Scene Builder 1.0 section, click the Samples link, and follow the prompts to save the javafx_scenebuilder_samples-1_0.zip file to your local file system.

  3. Extract the sample files from the zip file to a directory on your local file system.

  4. Go to the javafx_scenebuilder_samples-1_0-install directory in which you extracted the sample files.

  5. Run a sample by opening the project in the NetBeans IDE, compiling it, and then running it. For example, to run the HelloWorld application, open the HelloWorld project in NetBeans IDE, right-click the project node in the Projects window, and select Run.

    Source code for each sample is in the src folder for each NetBeans project.


    Tip:

    If you encounter an error running the sample, check that the JavaFX Platform settings in NetBeans IDE is configured correctly. For information about configuring NetBeans IDE to run with a specific JavaFX version, see Setting Up NetBeans IDE With JavaFX at http://netbeans.org/kb/docs/java/javafx-setup.html.


Using the Ant Utility

If you choose not to run the samples in NetBeans IDE, you can use the Ant utility to build and run the sample application on the command line. Type a command similar to that in Example 1 if you are using JDK 7 or Example 2 if you are using JDK 6 on a Windows platform.

Example 1 Ant Command to Run the Sample Application When Using JDK 7

ant -Dplatforms.Default_JavaFX_Platform.home=<JAVA_HOME>
    -Dplatforms.Default_JavaFX_Platform.javafx.runtime.home=<JAVA_HOME>/jre
    -f <JavaFX_Sample_App_Name>/build.xml
    <TARGET>

Example 2 Ant Command to Run the Sample Application When Using JDK 6 on Windows Platform

ant -Dplatforms.Default_JavaFX_Platform.home=<JAVA_HOME>
    -Djavafx.sdk=<JAVAFX_22_SDK_HOME>
    -Djavafx.runtime=<JAVAFX_22_RUNTIME_HOME>
    -f <JavaFX_App_Name>/build.xml
    <TARGET>

The main values for <TARGET> are clean, jar, and run. You can set <TARGET> with the value of -projecthelp to get a list of available targets. For example, to run the HelloWorld application on the Windows platform and using JDK 7, type something similar to that in Example 3. If you are using JDK 6 on a Windows platform, type something similar to that in Example 4.

Example 3 Using Ant to Run the HelloWorld Sample on a Windows Platform When Using JDK 7

ant -Dplatforms.Default_JavaFX_Platform.home="C:\Program Files\Java\jdk1.7.0_06" \
    -Dplatforms.Default_JavaFX_Platform.javafx.runtime.home=\
      "C:\Program Files\Java\jdk1.7.0_06\jre" \
    -f HelloWorld/build.xml run

Example 4 Using Ant to Run the HelloWorld Sample on a Windows Platform When Using JDK 6

ant -Dplatforms.Default_JavaFX_Platform.home="C:\Program Files\Java\jdk1.6.0_33" \
    -Dkjavafx.sdk="C:\Program Files\Oracle\JavaFX 2.2 SDK" \
    -Djavafx.runtime="C:\Program Files\Oracle\JavaFX 2.2 Runtime" \
    -f HelloWorld/build.xml run

To run the HelloWorld application on a Mac OS X platform with Java SE 7 update 6 software installed, type the command shown in Example 5.

Example 5 Using Ant to Run the HelloWorld Sample on a Mac OS Platform

ant -Dplatforms.Default_JavaFX_Platform.home=\
      /Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk/Contents/Home \ 
    -Dplatforms.Default_JavaFX_Platform.javafx.runtime.home=\
      /Library/Java/JavaVirtualMachines/jdk1.7.0_06.jdk/Contents/Home/jre \
    -f HelloWorld/build.xml run

Uninstalling JavaFX Scene Builder

To uninstall JavaFX Scene Builder, use the standard uninstall process for your operating system.