问题
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
{
}
回答1:
Simply follow these steps:
- Navigate to
Tools -> Options -> Editor
- Navigate to
Editor -> Formatting
- Select the following
- Language: Java
- Category: Braces
- In "Class Declaration, Method Declaration, etc."
- Braces Placement: New Line
回答2:
Also there's the JIndent plugin.
回答3:
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.
来源:https://stackoverflow.com/questions/2076262/is-there-a-way-for-netbeans-to-automatically-create-brackets-in-a-separate-line