Debugging bean customizers and property editors in NetBeans

Submitted by gunnar on

When you are developing GUI components you may want to create some nice bean customizers and property editors for them. But how do you debug them? The NetBeans developers may smile at this, knowing that there is a much better way, but I don't so smile away...

The trick is to start a new NetBeans instance in debugging mode. This is a built in feature of NetBeans module projects so we first need a simple NetBeans module. It doesn't have to do anything so you can create it in less than a minute using the New Project wizard:

1) Install the plugin NetBeans Plugin Development if you don't have it installed already.

2) Choose New Project, category NetBeans Modules, project type Module. All defaults can be accepted since it is just a dummy anyway. You need to choose a location and type a few letters in the package name field.

3) Now just right click the new module project and choose debug. A new NetBeans instance is started with its own empty profile directory so the first time it asks you if you want to import settings from your previous version. You probably don't need to but it doesn't hurt.

4) Open your GUI component project in the new instance and start testing your customizers in some test form. You can go back to your "real" NetBeans instance and set breakpoint in the customizers.

Perhaps not the most straightforward way of doing it but it works.