Download NetBeans

JavaFX 2.1

Editor showing open JavaFX2 project
Click image for full screen preview

JavaFX 2 is the next step in the evolution of Java as a rich client platform. It is designed to provide a lightweight, hardware-accelerated Java UI platform for enterprise business applications. With JavaFX 2, developers can create JavaFX applications completely in the Java programming language using standard Java development tools. They can even access native system capabilities, or seamlessly connect to server-based middleware applications. JavaFX 2.1 is bundled in Java JDK 7 update 4, for Windows and Mac. You can also download JavaFX 2.1 separately from Oracle.com. See Setting Up NetBeans IDE With JavaFX 2.1 for details.

JavaFX Projects new

Create JavaFX projects in the IDE. NetBeans IDE lets you create the following types of JavaFX project:

  • JavaFX FXML Application. JavaFX FXML applications use an FXML document to define graphic layout and a Java controller class to define actions. NetBeans IDE creates the FXML document and Java controller class. You can use the IDE's Java and XML code editing features to develop the application further.
  • JavaFX Application (without FXML). NetBeans IDE also lets you create a "traditional Java-style" JavaFX project, where graphic layout and actions are both defined in Java classes.
  • JavaFX Preloader. A preloader is a small application that is started before the main application to customize the startup experience. NetBeans IDE lets you create JavaFX preloaders either as separate projects or as part of a JavaFX application.
  • JavaFX in Swing Application NetBeans IDE simplifies the creation of Java SE applications that enable you to embed FX components using the JFXPanel Swing component.

Types of JavaFX Project in New Project wizard

Building and Running JavaFX Applications 

Build and run a JavaFX application as you build and run a standard Java application, with the difference that you can configure a JavaFX project to run in the following ways:

  • Standalone application. Project builds and runs as a standard Java desktop application.
  • Java Web Start. Application uses JNLP. The IDE generates the JNLP file when it builds the application.
  • In Browser. The IDE embeds the application in a browser, using an HTML page that calls a JNLP file. The IDE can generate the HTML page or you can use your own web page. If you run the application from the IDE, the IDE opens a browser page that points to the HTML page on your local file system.

JavaFX Project Properties showing build options

Editing JavaFX Code

Leverage NetBeans IDE's powerful Java code editor to code your JavaFX application.

JavaFX2 class in editor

Debugging JavaFX

Use NetBeans IDE's Java debugging tools, including the new GUI Visual Debugger, to debug your JavaFX application.

- See Using the Visual Debugger in NetBeans IDE for more information.

Take GUI Snapshot option from Debug menu

Sample Projects

Explore the features of JavaFX 2.1 and NetBeans IDE's support in more than 30 JavaFX 2.1 sample projects.

Sample JavaFX projects in New Project wizard

- JavaFX Documentation Home: Downloads, demos, FAQs and tutorials.

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo