Take a look into the folders that bother you, to see if there is anything of value in there, and - if you're happy with losing the data - just delete them (just in case, you might choose to leave them in the trash for a few weeks).
In the future, you can instruct your package manager to remove the application as well as associated system-wide configuration files by doing a purge.
- In synaptic,
right click the package and select
Mark for complete removal.
- On the command line, if you prefer,
sudo apt-get purge
This will delete any configuration and application data that the application has created system-wide, it will - of course - leave intact all the data that you have saved from within the application (i.e. NetBeans' project directory), this includes all the user-specific configuration that is saved in your home directory. Manual deletion is the only way to get rid of those.
If you want to find out what folders take up much space, there's the Disk Usage Analyser (Applications → Accessories → Disk Usage Analyser), select the "scan home" option to get a listing of everything in home, including hidden files.
Also, use the Computer Janitor (System → Administration → Computer Janitor) to clean up any rubbish that has been left behind by the package manager. In terms of the command line, this would be equivalent to doing
sudo apt-get autoremove && sudo apt-get autoclean.
Some applications, like NetBeans and AmaroK, may leave behind quite a bit of data. But there is no way for the system to automatically delete them without the risk of deleting something somebody actually wanted to keep. For the users' sake, there's no such feature; a good job considering you might have used netbeans for a few years before removing it - i'd be really annoying if apt deleted all your work to free 500 kilobytes. :-)