I seem to have found a fix, mentioned by Neil Smith at https://github.com/apache/netbeans/issues/5110
Some options need to be added to run.args.extra. So my project.properties file now contains:
run.args.extra=-J--add-opens=java.base/java.net=ALL-UNNAMED -J--add-exports=java.desktop/sun.awt=ALL-UNNAMED -J--add-opens=java.desktop/javax.swing=ALL-UNNAMED
..and the application GUI now starts without any of the previous exceptions.
I had thought that specifying these in default_options was enough, but apparently its needed in run.args.extra when run as GUI.
I had thought that specifying these in default_options was enough, but apparently its needed in run.args.extra when run as GUI.