NetBeans是否有办法在单独的行中自动创建括号?

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

/* * 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 { } 

只需按以下步骤操作:

  1. 导航到Tools -> Options -> Editor
  2. 导航到Editor -> Formatting
  3. 选择以下内容
    • 语言:Java
    • 类别:大括号
  4. 在“类声明,方法声明等”中
    • 大括号放置:新线

还有JIndent插件。

在Netbeans中,转到“ 工具” >“ 选项” 。 然后选择Formatting选项卡并在语言下拉列表中选择Java

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