Support for JavaFX 2 in IntelliJ IDEA 12.1

Over the last year we have been asked to add support for JavaFX 2 quite frequently. Today we are pleased to announce the first preview of the JavaFX 2 plugin for IntelliJ IDEA 12.1.

Having Java 7 installed you may create a new demo project based on JavaFX Application template:

On clicking finish you’ll get a template application ready to run:

There is a .fxml file describing sample layout, controller with handler and the main class. This is already sufficient to start an application and see the results.

Probably you would like to change some names. IntelliJ IDEA will help you to do this and will update all usages in .fxml files as well, e.g.

This means also that navigation between controller class, it’s fields and method handlers works.

In order to change the layout completely you will probably need to open SceneBuilder. Just point IntelliJ IDEA to the Scene Builder installation via File | Settings | JavaFX and call Open in SceneBuilder action via Help | Find Action | Open in SceneBuilder on the layout file.

If you need to make a small change IntelliJ IDEA could help you with smart completion of tags, attributes and even constants:

That’s all for today. In the next post we’ll show how can IntelliJ IDEA help you to skin your JavaFX Application with CSS.

Feel free to share your feedback on the discussion forum and report bugs in our issue tracker.

Develop with Pleasure!

Comments below can no longer be edited.

16 Responses to Support for JavaFX 2 in IntelliJ IDEA 12.1

  1. Avatar

    Ilan says:

    February 26, 2013

    Thank you very much for implementing this wonderful and anticipated feature to Intellij Idea!

  2. Avatar

    Žilvinas Urbonas says:

    February 26, 2013

    Hello here,
    I am kinda curious to ask, why no JavaFX in Community Edition?

  3. Avatar

    Anna Kozlova says:

    February 26, 2013

    JavaFX plugin is bundled in community edition. You are very welcome to give it a try.

    On the other hand in order to get specific CSS support you need to have CSS plugin which is available for ultimate edition only.

  4. Avatar

    Žilvinas Urbonas says:

    February 26, 2013

    @Anna Kozlova: thanks for response, so just to make sure,
    JavaFX plugin is bundled with IDEA 12.1 CE, but then why there is no “JavaFX Application” selection listed in “New Project” ?

  5. Avatar

    Anna Kozlova says:

    February 26, 2013

    Please ensure that the plugin is enabled (File|Settings|Plugins)? If you do have plugin enabled and still don’t have JavaFX Application available, please file an issue in youtrack.jetbrains.net

  6. Avatar

    Žilvinas Urbonas says:

    February 26, 2013

    @Anna Kozlova:
    It doesn’t even appear as a plugin in IDEA 12.1 CE, only in Ultimate

  7. Avatar

    Anna Kozlova says:

    February 26, 2013

    Sorry, the build layout was broken. In order to get the plugin to work you need to put it under plugins directory (copy from INSTALLATION_DIR/javaFX to INSTALLATION_DIR/plugins/javaFX). Thank you

  8. Avatar

    Žilvinas Urbonas says:

    February 26, 2013

    @Anna Kozlova: emm, the workaround doesn’t seem to work for me on Mac OS X

  9. Avatar

    mwalter says:

    February 26, 2013

    Great news! Waiting for FXML code completion so long…

  10. Avatar

    Žilvinas Urbonas says:

    February 27, 2013

    IDEA CE -128.18 seems to have solved all my problems, thanks!

  11. Avatar

    miltone says:

    March 2, 2013

    For me, the sample project “application JavaFX” don’t run.
    Java error with “page langage not specified” on this line :
    Parent root = FXMLLoader.load(getClass().getResource(“sample.fxml”));

  12. Avatar

    Anna Kozlova says:

    March 4, 2013

    Please file an issue (at youtrack.jetbrains.com) with attached project. Thanks

  13. Avatar

    Jerome says:

    March 12, 2013

    Very nice to have now JavaFx integrated in IntelliJ 🙂

    I only have an issue with SceneBuilder integration (which is required to have a decent FXML layout). I entered the SceneBuilder path correctly (double-ckecked), but trying to “Open in SceneBuilder” either from the sample.fxml editor or from Help|Find Action, Scene Builder is not launched.
    (note that I got today the 12.1 128.101 Community Edition)

    BTW, it would be cool to also have “Open in SceneBuilder” from the project window.

  14. Avatar

    Anna Kozlova says:

    March 12, 2013

    I suppose that you use SceneBuilder 1.1. We supported only SceneBuilder 1.0 which is a released version. The next EAP would support also SceneBUilder 1.1.

    If it is not the case, please specify your OS/SceneBuilder version.

  15. Avatar

    Marion says:

    March 13, 2013

    How do i create a executable jar of my JavaFx application? Currently I have a jar compile but is not executing.

  16. Avatar

    Anna Kozlova says:

    March 14, 2013

    IDEA doesn’t help you with that yet (please watch http://youtrack.jetbrains.com/issue/IDEA-90571). You may follow http://docs.oracle.com/javafx/2/deployment/jfxpub-deployment.htm to get it work right now.

Discover more