This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
When "Fix Imports" is invoked and there are multiple possible matches, always default to the most frequently chosen entry. That is, if whenever I was presented with classes A or B I always chose class A, then Netbeans should default to matching against A automatically.
I will second this and add some more explanation about the problem and potential solutions. In order to use the IDE as efficiently as possible, I tend to call a method in some class in my source code, then hit Alt+Enter to add the import statement for that class. In my view, having to deal with import statements gets in the way of the problem I am trying to solve and it's best when the IDE can handle this for me. When you have a unique classname (like TopComponent) the "use first, import later" method I describe works great. Where it fails is when you have a classname which exists in several packages. For example, if I am using Log4J in my project, then a reference to Logger should offer Log4J's logger as the first choice and java.util.Logger as the second. A more complex case might be a class like Node. In a given project, I might be using Node from the NetBeans Node API, an XML DOM node or a Java 3D node. In such a case, the IDE should be able to tell from the context (i.e. which method I invoked and what it's return value is) in order to tell which class to import. See also issues #154258 and #120614.
FYI: the basic import features contain a few heuristics to guess the correct types to import since 6.0. The Add import hint and Fix All Imports dialog painted the unsuitable imports in gray. It has been disabled for a while, as it was confusing users. Has been reenabled in 6.9 or 7.0 (don't remember exactly), but is only used to sort the suitable imports above the unsuitable. E.g., if you will add this into an empty class: List l = new ArrayList(); the java.util.List should be the first, as is the only import that matches java.util.ArrayList (which is the only accessible ArrayList in J2SE). There is a command line option to specify coloring for the unsuitable imports: -J-Dorg.netbeans.modules.java.editor.imports.JavaFixAllImports.invalid_import_html="<html><font color='#808080'>"