Netbeans Java code formatting issues -


I want to format some piece of java code in a more compact way than the default Netbeans formatting behavior; Netbeans are not able to set formatting options correctly for code snippets, so I will try to ask here:

1 / Netbeans formatting is possible to leave a line What is the method? For example:

  Public Zero Print Message (String Message) {System.out.println (Message); }   

Default behavior formats this snippet as follows:

  Public Zero print message (string message) {System.out.println ( message); }   

2 / Is it possible to initialize double braces in this form?

  Private List & lt; String & gt; List = New Arrestist & lt; String & gt; () {{// some code here}};   

Netbeans always use this code

  in the private list & lt; String & gt; List = New Arrestist & lt; String & gt; () {{// some code here}};   

Thanks for the tips.

Take a look at these sites for more information.

-

-

To adjust the formatting rules for Java files:

  • Select Tools -> gt; ; the option.
  • Click the editor in the left panel and select the Indentation tab.
  • Adjust the properties for the indentation engine on your taste.
  • Reformate each file by opening the new rules and pressing Ctrl + Shift + F (no text is selected).

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -