Symbol not found on netbeans visual database explorer module

45 views Asked by At

I am trying to make the Visual Database Explorer at Apache Netbeans 15 from this tutorial:

https://netbeans.apache.org/tutorials/nbm-visual_library2.html

Unfortunately on the first class I get this error:

"cannot find symbol symbol: class HelpCtx location: package org.openide.util"

Its seems the import of "org.openide.util.HelpCtx;" must be obsolete by the time tutorial written.

The class that this error appears is:

import java.sql.Connection;
import org.netbeans.api.db.explorer.ConnectionManager;
import org.netbeans.api.db.explorer.DatabaseConnection;
import org.netbeans.modules.db.explorer.action.BaseAction;
import org.openide.nodes.Node;
import org.openide.util.HelpCtx;

public final class ShowDatabaseStructureAction extends BaseAction {

    @Override
    protected void performAction(Node[] nodes) {

    }

    @Override
    protected boolean enable(Node[] activatedNodes) {
        return true;
    }

    @Override
    public String getName() {
        return "Show Database Structure";
    }

    @Override
    public HelpCtx getHelpCtx() {
        return HelpCtx.DEFAULT_HELP;
    }

}

Does anyone who have completed this tutorial can help? or is there a newer version for this tutorial?

Thanks in advance.

1

There are 1 answers

0
jjazzboss On

As explained in the tutorial (Setting Up the Module, point 5), you need to add some dependencies.

In your case you need to add a dependency on the "Utilities API" module.

Edit your module Properties, then select Libraries, Module Dependencies tab, then click and Add dependency...

Another way, more convenient, is to just click on the hint (light bulb) where the symbol is undefined (see image example below).

enter image description here