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!

This entry was posted in New Features and tagged . Bookmark the permalink.

16 Responses to Support for JavaFX 2 in IntelliJ IDEA 12.1

  1. Ilan says:

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

  2. Žilvinas Urbonas says:

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

  3. Anna Kozlova says:

    Hi,
    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.
    Thanks

  4. Žilvinas Urbonas says:

    @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. Anna Kozlova says:

    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. Žilvinas Urbonas says:

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

  7. Anna Kozlova says:

    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. Žilvinas Urbonas says:

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

  9. mwalter says:

    Great news! Waiting for FXML code completion so long…

  10. Žilvinas Urbonas says:

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

  11. miltone says:

    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. Anna Kozlova says:

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

  13. Jerome says:

    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. Anna Kozlova says:

    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.
    Thanks

  15. Marion says:

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

  16. Anna Kozlova says:

    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.
    Thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">