This is a very ancient question from years ago, but I didn't see this fix posted here yet.
https://www.samundra.com.np/solved-netbeans-long-running-project-scan/1246/1246
This will take you through adding a command to the netbeans config file. You will need to have administrator privileges to alter the config file, so you might need to figure out how to get that happening in win 10, 8, 7, or vista ... which can be found here (it's been hidden a little deeper recently.) You can get directions for doing that here:
https://www.howtogeek.com/howto/windows-vista/enable-the-hidden-administrator-account-on-windows-vista/
Read the www.samundra.com.np link and see if you want to try this solution. I tried it, and it seemed to speed up the scan significantly ... without disabling scanning (a mentioned solution, potentially unstable) ... and without using the disable patch (also mentioned, and also potentially unstable.)
So far, it worked well for me, and was not one of the common solutions mentioned above. Not sure I had any recursive links in my sources like the page mentions, but still, this sped up the scan significantly. So, see if it's an approach you want to try. The person who was involved in the bug report can be found here if you want to have a look at that too. It involves a recursive listener hanging and not quite having it's act together, so ... you are adding a config line to disable the listener.
https://bz.apache.org/netbeans/show_bug.cgi?id=207214
Make sure you add the line in the right place. For me, it was at the end of a loooong line beside netbeans_default_options. Make sure you place the line inside the ending quote.
Check it out if this is something you think you want to try, instead of the other fixes mentioned in this question. Cheers. That hang was getting annoying for sure! I did this in netbeans ver. 11.2