IntelliJ IDEA
 
Get IntelliJ IDEA
You are viewing the documentation for an earlier version of IntelliJ IDEA.

Auto import

Last modified: 10 August 2022

If you're using a class, a static method, or a static field that you haven't imported yet, the IDE shows you a tooltip prompting to add a missing import statement so that you don't have to add it manually. Press Alt+Enter to accept the suggestion.

If there's more than one possible source of import, pressing Alt+Enter will open the list of suggestions.

https://resources.jetbrains.com/help/img/idea/2022.1/auto-import.png
Gif

To change the background color for import tooltip, press Ctrl+Alt+S and go to Editor | Color Scheme | General | Popups and Hints | Question hint.