miamifan242
miamifan242

Reputation: 21

Netbeans formatting issue

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 boolean add(T payload)
{
    abarr_ListNode<T> nextNode = new abarr_ListNode<T>(payload);
    abarr_ListNode<T> firstNode = getFirstNode();
    abarr_ListNode<T> lastNode = getLastNode();

Thanks!

Upvotes: 2

Views: 728

Answers (1)

edwardsmatt
edwardsmatt

Reputation: 2044

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.

Upvotes: 3

Related Questions