简体   繁体   中英

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 . 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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