SECTION 11 Documentation and Help

Tip 86: Document Your Code with Javadoc

The IDE can remind you to add Javadoc comments to classes, and also display warnings to catch errors in your documentation. These Javadoc hints are turned off by default. Open the NetBeans Options window from the Tools window, and select Java Code > Hints. Activate Javadoc hints by checking the boxes in the Javadoc section.

The hints will show up on the left side of the editor as a lightbulb. Let’s say you declare a new class:

public MyClass() {}

With Javadoc hints activated, a lightbulb will now appear next to this line. Mouse over the lightbulb glyph to display the hint: “Create missing Javadoc for MyClass” Executing the hint will generate an empty Javadoc comment ...

Get 100 NetBeans™ IDE Tips & Tricks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.