DevFaqJavaModelGenerateImport

I am generating code that references a class. How can I generate an import statement for it?

Note: This FAQ item applies only to NetBeans 4.x and 5.x. The Java parsing infrastructure in NetBeans 6 has been replaced with a new API.

JavaModelUtil.resolveImportsForType()

See its javadoc and CreateParameterJavaHint.createParameter() (in java/hints) for an example of how to use JavaModelUtil.resolveImportsForType().

Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo