Resolving Identifiers

In Step 1 of the Import Management Tool wizard, any unresolved identifiers are listed.

To resolve an identifier listed in the Class Name column:

If the Guessing Strategy for Unresolved Identifiers is set to Search in Well-Known Packages, the IDE tries to search in your list of well-known packages to find unresolved class names. If your unresolved class is found in one or more of these packages, a package name is filled in for you. You can modify the name if necessary.

To enable this function, add your commonly used package names (such as javax.swing, java.util, and your own packages) to the List of Well-Known Packages property, and set the Guessing Strategy property to Search in Well-Known Packages. To set these properties, choose Project Settings Import Management Tool Settings.

Packages already referenced in your source file are automatically part of the Well-Known Packages list. For example, in the following source code:

import javax.swing.Jpanel;

class Test {
    java.util.Collection a;

    void method() {
	HashMap h=new HashMap();
	JButton b=new JButton();
    }
}
HashMap and JButton are resolved in Step 1 (assuming the Guessing Strategy is Search in Well-Known Packages), even if the List of Well-Known Packages property does not include javax.swing or java.util.
See also
Using the Import Management Tool
Creating Import Statements
Removing Unused Import Statements
Configuring the Import Management Tool
Adding an Import Statement With Fast Import

Legal Notices