NetBeans是否有办法在单独的行中自动创建括号? [英] Is there a way for NetBeans to automatically create brackets in a separate line?

查看:169
本文介绍了NetBeans是否有办法在单独的行中自动创建括号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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 
{

}


推荐答案

只需按照以下步骤操作:

Simply follow these steps:


  1. 导航至工具 - >选项 - >编辑

  2. 导航至编辑器 - >格式化

  3. 选择以下


    • 语言:Java

    • 类别:大括号

  1. Navigate to Tools -> Options -> Editor
  2. Navigate to Editor -> Formatting
  3. Select the following
    • Language: Java
    • Category: Braces

  • 大括号放置:新行

这篇关于NetBeans是否有办法在单独的行中自动创建括号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆