IntelliJ and JavaFX support


Question

I just tried to set up my first IntelliJ Java FX project. I was doing a tutorial where some fxml files are created. A screenshot from a eclipse window is shown:

enter image description here

I tried to do something similiar, but if I go to "new file", I cant even choose a fxml format. Is there no support in IntelliJ for that? I googled around but I couldnt find anything. Always it mentions I should try to enable the JavaFX support for my project, but it is enabled.

Any ideas?

Intellij 13.1, Ultimate Edition

1
5
10/15/2014 6:25:22 AM

Accepted Answer

Right Click on the folder you want to create the new file in (e.g. the ch.makery.address.view package), then select from the context menu:

New | File

Type the name of the fxml file you want to create (e.g. RootLayout.fxml).

You now have a blank fxml file which you can hand edit.

Hand editing fxml isn't really advised except for minor tweaks. So install SceneBuilder and you can edit the new fxml in SceneBuilder by right-clicking on the fxml filename in the Idea project window and choosing "Open in SceneBuilder".

See also, this related question on what constitutes a JavaFX project in Intellij Idea.

6
5/23/2017 12:22:55 PM

Licensed under: CC-BY-SA with attribution
Not affiliated with: Stack Overflow
Icon