Becoming a Proficient NetBeans Module Developer
Note: These pages are being reviewed.
The NetBeans Platform has a learning curve. The goal of this FAQ is to get you over the basic humps quickly. Being proficient does not necessarily mean knowing everything there is to know. It means being able to find what you need to know quickly when you need it. Here are some pointers.
The reference documentation for all of NetBeans APIs can be found on the web here: http://bits.netbeans.org/dev/javadoc/index.html.
If you want a local copy of it, you can either download it from the update center, or build it from your source checkout
cd $NB_SRC_ROOT ant build-javadoc
Notice the list of APIs in the upper left in the javadoc. These restrict the list of classes to a single API. /Also notice the link that says javadoc next to each API name. It’s important! This links to the overview page for each API. That page contains a list of changes, an architecture description, and other very useful stuff!/
There are a huge number of tutorials. Do at least some of them - step by step.
There is a huge Frequently Asked Questions for Module Developers list. It is worth bookmarking.
Some people claim that they should never need to look at source code - documentation should suffice. That’s just silly. The NetBeans codebase is a treasure-trove of examples of how to do things.
Since the end of January 2008 the NetBeans sources are stored in Mercurial repository at hg.netbeans.org.
You can see useful documentation about Mercurial and also about its specifics for NetBeans repository in HgMigrationDocs wiki topic. If you are already familiar with Mercurial you cat go directly to HgHowTos topic.
You will end up with a large number of directories representing top-level NetBeans projects. Most of them will be openable as projects in NetBeans.
Here’s how to build it.
The build of NetBeans will be created in
See the tasks to APIs faq for a list of common tasks and what APIs you will want to use to accomplish those tasks.
There are a large number of samples. Many of these correspond to the tutorials.
Two full blown NetBeans Platform applications are provided as samples in NetBeans IDE. Look in the Samples category in the New Project dialog and you will find the FeedReader sample and the Paint sample, for both of which there are tutorials describing how to create them from scratch.
You can find several other samples in the module
main/misc repository at hg.netbeans.org. They are in the
platform/samples/ subdirectory. The
platform/samples/ folder can be browsed online here.
For most things you will need to do, there is some module that does something similar already. For example, say that you want to show a window that shows the contents of some random directories on disk or some registry of objects your module creates. The
core/favorites module provides the Favorites window which does exactly this. A bit of intuition and a willingness to open a couple of projects is all it takes to find examples of many things. Often a good place to start is simply to open the source for a class you think you want to use and run Find Usages on it.
You can also browse the archives online, but actually joining the mailing list is the best way to get (and give) help.
Ask questions, and when you can answer them, do that too. There is a very healthy and helpful community there.