Geertjan's Blog

  • May 11, 2012

Mass Format in NetBeans IDE 7.2

Geertjan Wielenga
Product Manager

Prior to the upcoming 7.2 release, the Source | Format menu item would be disabled, unless the currently selected window was an editor document.

In 7.2, you can select any of these:

  • project node
  • Source Packages node
  • package node
  • folder node

And you can also select multiple nodes, from various kinds, of the above. You'll then see that Source | Format is enabled and functions as you might expect:

When the action is invoked everything within the selected nodes is formatted as defined by the rules defined in the Options window.

Related issue: https://www.netbeans.org/bugzilla/show_bug.cgi?id=67397

Join the discussion

Comments ( 7 )
  • alex Friday, May 11, 2012

    Will this format java sources, xml, jsp/jsf at the same time?

  • Geertjan Friday, May 11, 2012

    Yes, uploading a movie to YouTube right now to illustrate this and will then paste it inside this blog!

  • rio Friday, May 11, 2012

    Nice. I've been waiting for this feature since version 6

  • ric Sunday, May 13, 2012

    is there a similar feature for the "fix imports" and for the @Override annotations?

  • rio Monday, May 14, 2012


    You can use the Inspect and Transform feature, available from version 7.1

    Right click on a package > Refactor > Inspect and Transform, then use the "Organize Imports" & "Add @Override Annotation" option


  • Mike Wednesday, April 29, 2015

    Can this be done via command line? I would like to put this into my git hooks.

  • Geertjan Wednesday, April 29, 2015
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.