java-netbeans-formatting-将花括号保持在同一行?

java-netbeans-formatting-将花括号保持在同一行?,netbeans,formatting,curly-brackets,Netbeans,Formatting,Curly Brackets,我希望保留这样的代码并使用autoformat: try { System.out.println("oh"); } catch(Exception e) {} try { System.out.println("hey"); } catch(Exception e) {} 但netbeans重新格式化为: try { System.out.println("oh"); } catch (Exception e) { } try { System.out.println("he

我希望保留这样的代码并使用autoformat:

try { System.out.println("oh"); } catch(Exception e) {}
try { System.out.println("hey"); } catch(Exception e) {}
但netbeans重新格式化为:

try {
    System.out.println("oh");
} catch (Exception e) {
}
try {
    System.out.println("hey");
} catch (Exception e) {
}
有没有办法防止这种情况?保持try/catch,或者至少保持{}在同一行?

这有以下答案:

查看工具->选项->编辑器->格式

供进一步参考: