开发者

Netbeans formatting issue

开发者 https://www.devze.com 2023-02-22 03:18 出处:网络
I am trying to set my formatting to the way my professor wants it for my class, and everything is right except that public and private have their own line and cannot find the option to get rid of that

I am trying to set my formatting to the way my professor wants it for my class, and everything is right except that public and private have their own line and cannot find the option to get rid of that. Thanks for the help!! Id post a picture but i guess you cant do that after you first make an account.

Right now it looks like this after it is formatted:

public
    boolean add(T payload)
{
    abarr_ListNode<T> nextNode = new abarr_ListNode<T>(payload);
    abarr_ListNode<T> firstNode = getFirstNode();
    abarr_ListNode<T> lastNode = getLastNode();

Id like it to look like this:

public boo开发者_JS百科lean add(T payload)
{
    abarr_ListNode<T> nextNode = new abarr_ListNode<T>(payload);
    abarr_ListNode<T> firstNode = getFirstNode();
    abarr_ListNode<T> lastNode = getLastNode();

Thanks!


For the modifier (public, private etc...) check the following:

Tools --> Options --> Editor --> Formatting.

Select Java from the Languages drop down list.

Select Alignment from the Category drop down list.

Ensure that the after modifiers checkbox is unchecked.

To place the curly-brace on a new line (from the same formatting tab):

Select Braces from the Category drop down list.

Select New Line from whichever of the drop down lists in the Braces Placement Section is relevant to you.

0

精彩评论

暂无评论...
验证码 换一张
取 消