IntelliJ IDEA 2021.2 Help

Create a new JavaFX project

JavaFX is a software platform that is used for developing desktop applications that can run across a wide variety of devices.

JavaFX support in IntelliJ IDEA includes code completion, search, navigation and refactoring in JavaFX-specific source files (including .fxml and JavaFX .css files), integration with JavaFX Scene Builder, JavaFX application packaging capabilities, and more.

Make sure the JavaFX plugin is enabled

To be able to work with JavaFX in IntelliJ IDEA, the JavaFX bundled plugin must be enabled:

  1. In the Settings/Preferences dialog Ctrl+Alt+S, select Plugins.

  2. Switch to the Installed tab and make sure that the JavaFX plugin is enabled.

    If the plugin is disabled, select the checkbox next to it.

  3. Apply the changes and close the dialog. Restart the IDE if prompted.

Create a new project

When you create a new JavaFX project, IntelliJ IDEA generates a fully configured sample application.

  1. Launch IntelliJ IDEA.

    If the Welcome screen opens, click New Project.

    Otherwise, from the main menu, select File | New | Project.

  2. In the New Project wizard, select JavaFX from the list on the left.

  3. Name the new project, change its location if necessary, and select a language, a build system, and a test framework.

  4. In the Group field, specify the name of the package that will be created together with the project.

  5. Select the JDK that you want to use in your project.

    If the JDK is installed on your computer, but not defined in the IDE, select Add JDK and specify the path to the JDK home directory.

    If you don't have the necessary JDK on your computer, select Download JDK.

    Click Next.

    Creating a new JavaFX project
  6. On the next step of the wizard, select the libraries that you want to use in your application and click Finish.

    Creating a new JavaFX project

Run the application

  1. Open the HelloApplication.java class, click the Run application icon in the gutter, and select Run 'HelloApplication.main()'.

    The IDE starts compiling your code.

  2. When the compilation is complete, the application window appears.

    This means that the project is configured correctly and everything works as it should.

Troubleshoot

  • Process finished with exit code -1073740791 (0xC0000409)

    The problem is caused by an error in the NVIDEA driver. Update your driver to the latest version. For more information, refer to the community forum.

  • "..." cannot be opened because the developer cannot be verified.

    The problem is caused by notarization in macOS software. Follow the steps in the discussion to resolve the problem.

Last modified: 17 August 2021