Change the way to automatically order the code in netbeans 8.2?

1

In netbeans in the code of a project, when you press: Control + Shift + F Reorder the code automatically, but reorder it in this way:

try{
     if(1>2){

     } else { 

     }
}catch(Exception e){

}

My doubt comes, in that if there is no way in the configurations or make a command to order it in this way, adding the line break:

try
{
    if(1>2)
    {

    } 
    else 
    { 

    }
}
catch(Exception e)
{

}
    
asked by Villatoro 29.07.2017 в 21:21
source

1 answer

1

You can configure this on Mac from Netbeans > Preferences > Editor > Formatting , in Windows: Window > Options > Editor > Formatting

go to Language: Java and Category: Braces

set Method declaration and Other: as New Line :

In this way, when applying the format, it will be applied as you wish in your question.

    
answered by 29.07.2017 / 22:08
source