如何在Netbeans中配置Java导入的组织 [英] How to configure organizing of Java imports in Netbeans

查看:179
本文介绍了如何在Netbeans中配置Java导入的组织的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

目前Netbeans(我正在使用V7.3.1)具有内置的功能,可以通过菜单 Source»Organize Imports 组织导入Java文件。但是我需要改变导入的默认顺序。 (例如,在共享环境中工作时,软件开发人员必须使用相同的导入设置。)

有什么方法可以这样做吗?



$ b


  1. 点击工具→选项点击编辑图标。

  2. 将语言设置为: Java

  3. Imports

  4. 根据需要更改设置。
  5. 点击确定应用保存所做的更改。
    b
    $ b

    点击工具→选项,即可保存汇入:

  6. 单击编辑图标。 li>
  7. 选中删除未使用的导入

  8. 选中组织
  9. 点击确定应用保存更改。


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. 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.
  5. Set Category to: 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.

这篇关于如何在Netbeans中配置Java导入的组织的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆