简体   繁体   English

如何在Netbeans中配置Java导入的组织

[英]How to configure organizing of Java imports in Netbeans

Currently Netbeans (I'm using version 7.3.1) has an in-built ability to organize imports in Java files via menu Source » Organize Imports . 目前Netbeans(我使用的是7.3.1版本)具有通过菜单Source»Organize Imports组织Java文件导入的内置功能。 But I need to change the default order of imports. 但我需要更改导入的默认顺序。 (For example, when working in a shared environment, software developers must use the same import settings.) (例如,在共享环境中工作时,软件开发人员必须使用相同的导入设置。)

Is there any way to do so? 有没有办法这样做?

Try: 尝试:

  1. Click Tools → Options . 单击工具→选项
  2. Click the Editor icon. 单击编辑器图标。
  3. Click the Formatting tab. 单击“ 格式”选项卡。
  4. Set Language to: Java . 语言设置为: Java
  5. Set Category to: Imports . 类别设置为: Imports
  6. Change the settings as desired. 根据需要更改设置。
  7. Click OK or Apply to save the changes. 单击“ 确定”或“ 应用”以保存更改。

To organize the imports on save: 要在保存时组织导入:

  1. Click Tools → Options . 单击工具→选项
  2. Click the Editor icon. 单击编辑器图标。
  3. Click the On Save tab. 单击“ 保存”选项卡。
  4. Check Remove Unused Imports . 选中删除未使用的导入
  5. Check Organize Imports . 检查组织进口
  6. Click OK or Apply to save the changes. 单击“ 确定”或“ 应用”以保存更改。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM