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 に答える