I am using Netbeans IDE 17. I have a problem with setting a different JavaFX platform version. Therefore I cannot create new JavaFx project.
Tools/Java Platforms:
When creating a new JavaFX project I tried multiple times to add new platforms, but I cannot choose them in the combobox:
The good news is that your issue is fairly easy to fix. The bad news is that you are going to encounter another problem once that is resolved, for which there is no easy fix.
First, note from your screen shot that you are invited to provide a "JavaFX Platform" rather than just a "Java Platform". That is, you need to provide a JDK which includes the JavaFX modules, and presumably your selection of JDK 20 (Default) is not valid.
Azul Systems and BellSoft are two JDK vendors offering editions that bundle the necessary JavaFX (OpenJFX) libraries. Here is a screen shot of the Azul site, https://www.azul.com/downloads/?package=jdk#zulu
Be sure to specify JDK FX for the Java Package. I downloaded the zip (rather than the msi) and after unzipping had a top level directory named zulu19.32.15-ca-fx-jdk19.0.2-win_x64. Use Tools > Java Platforms > Add Platform... to create a new Java platform, specifying that directory. I named my new platform Java193215Azul:
Now you should be able to avoid the problem shown in your screen shot. Navigate to File > New Project... > Java with Ant > JavaFX > JavaFX Application, and click Next >. On the New JavaFX Application screen in the JavaFX Platform field select the Azul SDK you just downloaded and added as a Java platform:
There should be no error now, and you can click Finish to generate your project.
That resolves your issue, but it's important to note that when you build the JavaFX application generated by the NetBeans wizard you will get an unrelated build error:
A bug report for that issue was raised almost a year ago, but has not been resolved. See the NetBeans Bug Build Failed #3996:
When I build javafx app this error appear "Unable to create javax script engine for JavaScript in javafx".
To avoid this issue there are alternative approaches for JavaFX development which may or may not suit you:
One final point: although you can't build a JavaFX project generated by the wizard when using Ant, it is still possible to run the file containing the main() method that was generated by the wizard, using Run > Run File. Here's a screen shot showing that file being run after I made a couple of cosmetic changes in the code:
Of course that approach has limited value, but I mention it for completeness.