5

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

NDY
  • 3,527
  • 4
  • 48
  • 63

1 Answers1

6

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.

Community
  • 1
  • 1
jewelsea
  • 150,031
  • 14
  • 366
  • 406
  • Also, you can add your own file template in Idea, based on automatically generated fxml on project creation. – Ivan Mar 13 '15 at 01:22