Chapter 16. Developing Modules—the New Module Wizard

The HelloWorld Module

In this chapter, we will walk through creating and running a trivial module.

Creating a Module Using the New Module Wizard

The quickest way to make a new module is by using the New Module Wizard as shown here:

  1. Select File New and in the wizard that appears, select Templates NetBeans Extensions IDE Plug-in Module.

  2. First you must choose a name for the module JAR (try helloworld) and a place to put it. The exact location is not very important. You will also be asked to choose a display name for the module that the user will see (try Hello World), and a location in which to put the classes and resources that will form a part of your new module. Choose a package name, such as com.mycompany.nbmodules.helloworld.

  3. We will create a module with just one feature in it: it will add a new menu item to the IDE. So in the appropriate step of the wizard, ask to add a menu or toolbar item, but do not request a new file type.

  4. Next you must choose where your new menu item will go. Pick some menu in the IDE, such as File. You can specify exact placement in the menu as well. For now it does not matter, so select any position in the menu. Give the menu item a name, such as Say Hello; you may also select an icon (in GIF format at 16 X 16 size) to use for the menu item, if you wish.

  5. You will be prompted to provide a version number, category, and description for the module. These pieces of information are not important for ...

Get NetBeans: The Definitive Guide 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.