Adding New Tabs to the Project Properties Dialog in NetBeans IDE

DZone 's Guide to

Adding New Tabs to the Project Properties Dialog in NetBeans IDE

· Java Zone ·
Free Resource

Let's extend the Project Properties dialog of an existing project type in NetBeans IDE (or any application on the NetBeans Platform that makes use of the NetBeans IDE's project system):

To achieve the above, we'll create a small NetBeans module with this structure:

Now, for the code. We'll be using the @ProjectCustomizer.CompositeCategoryProvider.Registration annotation for generating layer.xml entries at compile time, which is a new annotation in NetBeans Platform 6.8, therefore the following applies to NetBeans Platform 6.8 only:

import java.util.ResourceBundle;
import javax.swing.JComponent;
import org.netbeans.spi.project.ui.support.ProjectCustomizer;
import org.netbeans.spi.project.ui.support.ProjectCustomizer.Category;
import org.openide.util.Lookup;
import org.openide.util.NbBundle;

public class AdditionalJ2SECompositePanelProvider implements ProjectCustomizer.CompositeCategoryProvider {

    private static final String MURPHY1 = "Murphy1";
    private static final String MURPHY2 = "Murphy2";

    @ProjectCustomizer.CompositeCategoryProvider.Registration(projectType = "org-netbeans-modules-java-j2seproject", position = 100)
    public static AdditionalJ2SECompositePanelProvider createMurphy1() {
        return new AdditionalJ2SECompositePanelProvider(MURPHY1);

    @ProjectCustomizer.CompositeCategoryProvider.Registration(projectType = "org-netbeans-modules-java-j2seproject", position = 200)
    public static AdditionalJ2SECompositePanelProvider createMurphy2() {
        return new AdditionalJ2SECompositePanelProvider(MURPHY2);
    private String name;

    private AdditionalJ2SECompositePanelProvider(String name) {
        this.name = name;

    public Category createCategory(Lookup lkp) {
        ResourceBundle bundle = NbBundle.getBundle(AdditionalJ2SECompositePanelProvider.class);
        ProjectCustomizer.Category toReturn = null;
        if (MURPHY1.equals(name)) {
            toReturn = ProjectCustomizer.Category.create(
        } else {
            toReturn = ProjectCustomizer.Category.create(
                    bundle.getString("LBL_Config_Murphy2"), // NOI18N
        return toReturn;

    public JComponent createComponent(Category category, Lookup lkp) {
        String nm = category.getName();
           if (MURPHY1.equals(nm)) {
            return new NewJPanel1();
        } else {
            return new NewJPanel2();


Reference is made above to the Bundle file, containing these keys:

LBL_Config_Murphy1=Murphy 1
LBL_Config_Murphy2=Murphy 2

Read the related Javadoc, i.e., the ProjectCustomizer class.

Believe it or not, with very little coding (and no painful layer.xml registrations)... you're done! Run the application and look in the Project Properties dialog of a Java project in NetBeans IDE, since that's the project type for which the above has been registered. There you should see your new tabs.


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}