How may I grant priviliges to Netbeans so that it can modify necessary files/directories while downloading extra packages?
You will have to change the modes on the directories and files that you want it to write.
It would seem that you've somehow installed netbeans while running as a user other than yourself (presumably root), and so places it wants to write to are not writable.
The best solution would be to unwind that and install netbeans as yourself, then it will have enough access. If you can't do that, you might get best results by using chgrp to put the netbeans material into a group you are in (the groups command will tell you which ones are those) and then chmod g+w to give group write.