views:

188

answers:

3

When I create a new class for instance, I get this:

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package helloworld;

/**
 *
 * @author Sergio
 */
public class WordManipulations{        
}

I hate it when brackets are placed this way. Is there a way to make it create things like this:

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package helloworld;

/**
 *
 * @author Sergio
 */
public class WordManipulations 
{

}
+8  A: 

Its easy.

Goto:

Tools->Options>Editor
Editor->Formatting

Select Language : 'Java' and Category : 'Braces'
Change the 'Braces Placement' of 'Class Declaration,Method Declaration etc' from "Same Line" to "New Line"

Enjoy!

Prasoon Saurav
Wow so incredibly simple. Netbeans is really impressive.
Sergio Tapia
Unfortunately this is currently broken (for C/C++ and PHP at least) in Netbeans 6.8 :(
therefromhere
+1  A: 

In Netbeans go to Tools > Options. Then select the Formatting tab and select Java under the language drop down.

There are now several options to change the formatting the way you like it.

Vincent Ramdhanie
+2  A: 

Also there's the JIndent plugin.

Ondra Žižka