点击如下图所示,打开配置目录

IDEA设置导包功能

找到Editor--->General---->Auto Import

Add unambiguous imports on the fly:自动导入不明确的结构。

Optimize imports on the fly:自动帮我们优化导入的包

IDEA设置导包功能

相关文章: