Netbeans and refactoring

advertisements

I have Netbeans 7. When I have it generate my getters and setters it does:

public void foo() {
}

Whereas I need it to do:

  public void foo()
  {
  }

Where the starting brace is on the next line.

The same thing happens when I use Source->Format, I need the method brace on the next line.

Is there a way to set this?

Thanks


From the main menu bar,

  • select tools then options,
  • click on the editor icon,
  • select the formatting tab,
  • select java on the language drop down list
  • and select braces from the category drop down list.

Then select new line for the item method declaration in the braces placement group.