Accessing and Using the Javadocs

One of the primary sources of documentation for the WPILibJ code is the Javadoc documentation generated from specially formatted comments embedded throughout the code. This document will explain what it contained in these documents, how to access them and how to connect them to NetBeans when developing code.

Overview of Javadoc

Javadoc is a tool used to generate HTML documentation from Java source code. This documentation contains summaries of classes and methods, descriptions of parameters and return values, information about deprecated classes and/or methods and details about hiearchy of classes.

Finding the Javadoc

Finding the Javadoc

The Javadoc documentation for WPILibJ is installed with the FRC plugins. To locate the Javadoc, browse to your User folder (on Windows 7 this is C:\Users\*Username*), then browse to sunspotfrcsdk/doc/javadoc. Double click on the index.html file to open it in your default webbrowser.

The Javadoc HTML pages have 4 main components:

  1. Package Browser - This pane is visible on all pages and allows for browsing to the page for any of the packages in the API
  2. Class Browser - This pane is visible on all pages and allows for browsing to the page for any class in the API
  3. Nav Bar - This bar is visible at the top of every page and allows for browsing to a few main overview pages
  4. Main Display - This is the portion of the page that changes to display the appropriate information for each level of the Javadoc

Linking the Javadoc to the Library in Netbeans

It is also possible to access the Javadoc for a particular package, class or method from Netbeans. To do this, first the Javadoc must be linked to the library:

  1. Click Window
  2. Hover over Other to expand the menu
  3. Select Javadoc to display the Javadoc window in the bottom pane
  4. Highlight a class, method or package from WPILib
  5. In the bottom pane, click the Attach Javadoc... link
  6. In the dialog that appears, click Browse
  7. Browse to the Javadoc folder *USER*\sunspotfrcsdk\doc\javadoc then click Add ZIP/Folder
  8. Click OK.

Accessing the Javadoc from Netbeans

Accessing the Javadoc from Netbeans

There are a few ways to use the Javadoc from within Netbeans:

  1. Select the desired package, class or method name, right-click and select Show Javadoc. This will launch your default web browser and navigate to the Javadoc for the selected item.
  2. Highlight the desired package, class or method name and click on the Javadoc tab in the bottom pane (if this tab is not present you can re-add it as shown in the step above)
  3. When using code completetion, hover over an item in the list and the Javadoc will be shown.