CTRL + 1 can also be used which will suggest to import.
Some other useful shortcuts:
Ctrl+Shift+ any key :Direct actions (on text mostly)
Alt+Shift+ any key : Indirect actions
Ctrl It was originally used to send Control character to terminals. Ctrl commands are commonly used shortcuts. (In Mac Command)
Alt It enables alternate uses for other keys.
The above shortcuts are default, if we want to change shortcuts we can do. In eclipse -> Windows -> preferences -> keys. Where we can find all shortcuts with full details:
and
https://shortcutworld.com/IntelliJ-IDEA/win/IntelliJ_Shortcuts
https://shortcutworld.com/Eclipse/win/Eclipse-Helios_Shortcuts
https://www.jetbrains.com/help/idea/migrating-from-eclipse-to-intellij-idea.html#Shortcuts
You also can enable this import as automatic operation. In the properties dialog of your Java projects, enable organize imports
via Java Editor
- Save Action
. After saving your Java files, IDE will do organizing imports, formatting code and so on for you.
Some useful shortcuts. You're looking for the 1st one...
Source Here
For static import select the field and press Ctrl+Shift+M
Ctrl+Space : Show Imports
This displays imports as you're typing a non-standard class name provided the proper references have been added to the project.
This works on partial or complete class names as you are typing them or after the fact (Just place the cursor back on the class name with squigglies).
IntelliJ just inserts them automagically; no shortcut required. If the class name is ambiguous, it'll show me the list of possibilities to choose from. It reads my mind....
Source: Stackoverflow.com