How do I get the packages contained in a jar/library/dependency?
If you want to display it as a Node you can use:
org.netbeans.spi.java.project.support.ui.PackageView.createPackageView().
If you need just a list of packages it can be obtained by
ClassIndex.getPackageNames()
for jars which were scanned by indexing.
— provided by Tomas Zezula