Question

I am creating a application using Netbeans Appication development.

i have created a API and a lookup that checks for all the implementation and displays them to a Jlist placed inside a TopComponent.

public interface DemoAPI {
public String getType();
public String getName();
}

used

Lookup.Result<DemoAPI> DemoResult;
DemoResult=Lookup.getDefault().lookupResult(DemoAPI.class);

public void resultChanged(LookupEvent ev) {
        for (DemoAPI demo : DemoResult.allInstances()) {
        //Added the demo to Jlist using demo.getName() as display Name
    }
    }

for getting all the implementation of DemoAPI and Displaying in ListBox.

How can i Display the properties (Type and Name) in the propertySheetView for the corresponding selected Jlist Value.

Was it helpful?

Solution

To achieve this you most certainly need to use Nodes combined with an ExplorerManager and a corresponding view, replacing your JList.

This tutorial explains the basics of nodes and using them with an ExplorerManager and all kind of different views. In your created nodes you would override the getSheed()-Method and create your PropertySheet there.

The Netbeans Developer FAQ is a nice place which descripes a lot of the usual tasks when developing an application. Nodes and Explorer should tell you a lot about Nodes, ExplorerManagers and the several Views. Properties and PropertySheets has some nice extra info regarding PropertySheets.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top