Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IntelliJ and JavaFX support

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

like image 936
NDY Avatar asked Oct 15 '14 06:10

NDY


1 Answers

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.

like image 76
jewelsea Avatar answered Oct 10 '22 03:10

jewelsea