Friday, August 12, 2011

How to view Javadoc in Netbeans IDE 7.0

Recently I have downloaded Netbeans IDE 7.0 to learn its GUI builder Matisse and I was impressed with the changes I saw in the Netbeans from  my last use of it on 2007. I was a hardcore Netbeans fan when I was developing mobile application using J2ME and Netbeans integrated environment with WTK, Profiler and Network Monitor just rocks and on top of that they had conditional compilation feature based on type of platform you   were working like you could maintain your code easily even if you are using device specific libraries e.g. Nokia UI library etc. Anyway those were the things of past, what attracted me is the Javadoc feature of Netbeans. Though this feature might have been existed long back I have just started using it. Earlier to see javadoc I used to Google and then go to Sun (now Oracle) website to view javadoc of any class. While playing with Netbeans I discovered that you can easily javadoc in the Netbeans IDE itself no need to visit the web.



There are multiple ways to see javadocs in Netbeans:

1) Select any java class and right click you will see an option "Show Javadoc" which will open the javadoc in brower. You can also use keyboard   shortcut "alt+F1" to do this fast. You can also learn my favorite eclipse keyboard shortcut here.



2) By using JavaDoc Index Search: javadoc index search is another cool feature provided by Netbeans IDE which is allowed to search for any Java class  or interface or anything and display the result in same window. To open javadoc index search window go to Help -->Java Doc Index Search option or press keyboard shortcut "Shift + F1"



3) By opening Javadoc window in Netbeans:  to open javadoc window in Netbeans go to Window-->Others-->Javadoc and this will open javadoc window which is perfect way of seeing java doc along with writing code. Another cool feature of this javadoc window is you just need to focus on any java class an it will automatically show the javadoc for that class. It also provides buttons to move back and forward for easy navigation and best is yet to say you can open the source file of that java class right in front of you by click button "Open Source in editor" simply awesome isn't it.

Though I have been using Eclipse from past few years I must say some of Netbeans IDE feature are simply great. One of them is there Swing GUI builder and the other one I like is there javadoc integration in IDE.

On side note Javadoc just comes integrated to me because I have downloaded JDK1.6+ Netbeans 7 bundle but in case you want to add javadoc for some other API or platform you can easily do this by following below Steps

Adding Javadoc in Netbeans IDE

  1. Go to Tools-->Java Platform It will open Java platform manager.
  2. Select the java platform for which you want to add javadoc could be J2ME also.
  3. Click on Javadoc tab and then just click the button Add Zip/Folder, point out your already downloaded javadoc and you are done.
That’s all on Javadoc and Netbeans IDE for now. Enjoy.

Related post: 


1 comment :

Justin Hamade said...

What about javadoc in netbeans with UMLGraph?

Post a Comment