I had all of the problems mentioned. I had to edit the netbeams configuration file with the location of the JDK as recommended.
I installed NetBeans 12 and tried it with JDK 11. It ran but the dialog boxes froze. I installed JDK 15. Again, it ran but the dialog boxes froze, but this time with a different behavior.
I tried the solution
Settings - General - Prefer tabs: never
by jfarjona and that worked for me. All is good now. Thanks for all these suggestions.