Exclude Class/Package from InelliJ auto-import feature

cameron1024 :

I work primarily with JavaFX, and do not plan to use Swing or AWT. However, when I type Button for the first time in a class, and Intellij auto-imports the class, it often imports java.awt.Button, instead of javafx.scene.control.Button.

Is there any way to specify a list of packages/classes to not auto-import in Intellij to prevent this behaviour?

I have searched through IntelliJ docs, but cannot find anything relating to this particular issue.

Any help appreciated.

Andrew Tobilko :

Look into "Editor" > "Auto Import" > "Exclude from import and completion".

enter image description here

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=132067&siteId=1