My Favorite NetBeans Features
By divas on Nov 18, 2008
There has been one NetBeans feature that has been a life saver for me. It was around in 6.1, but I didn't know about it until I saw Brian Leonard use it in our JavaOne hands-on lab to figure out what a lab participant had done wrong -- local history. He used it to back track what the guy had done to see where he deviated from the lab.
As a tech writer, I spend a lot of time trying to figure out how to do something without the advantage of having documentation (cart before the horse thingee). If my experiments don't work, I right-click the file's tab in the editor and choose Local History > Show Local History. I can use the local history to quickly and safely back out my changes and try a different route. I can also use it to highlight the code that I changed (see below) so that I can examine it carefully to make sure I didn't make a mistake.
Comparing files is old technology that has been around since UNIX was invented (probably even before that), but NetBeans takes it to the next level. For example, I recently realized that I had accidentally made changes to a duplicate file instead of the one I was currently working on. Rather than trying to remember what I had done, and then trying to recreate the changes exactly, I simply opened the working document in the editor, right-clicked on the tab, and chose Diff To. I pointed to the older version and got the following output. All I had to do was click the arrows to bring the changes over to the new file.