20

例如,当我创建一个新类时,我得到了这个:

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

package helloworld;

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

当括号以这种方式放置时,我讨厌它。有没有办法让它创造这样的东西:

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

package helloworld;

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

}
4

3 回答 3

43

只需按照以下步骤操作:

  1. 导航Tools -> Options -> Editor
  2. 导航Editor -> Formatting
  3. 选择以下
    • 语言:Java
    • 类别:大括号
  4. 在“类声明、方法声明等”中
    • 大括号放置:新线
于 2010-01-16T05:15:53.637 回答
2

还有 JIndent 插件。

于 2010-01-16T07:12:37.333 回答
1

在 Netbeans 中,转到Tools > Options。然后选择格式选项卡并在语言下拉菜单下选择Java 。

现在有几个选项可以按照您喜欢的方式更改格式。

于 2010-01-16T05:16:08.567 回答