title: How to append a newline to StringBuilder? append(“\n”) or append(System.getProperty("line.separator")) doesnt works
body: <p>I am doing a java program in Netbeans on windows os. I have a StringBuilder object</p>
  
  <pre><code>StringBuilder builder = new StringBuilder();
  </code></pre>
  
  <p>I have to append newline to it. I have tried</p>
  
  <pre><code>builder.append(“\n”);   
  builder.append(System.getProperty("line.separator"));
  builder.append(System.lineSeparator()); 
  </code></pre>
  
  <p>It works when am displaying the output through System.out.println(builder);
  But none of them works when am displaying it to a jTextField. What is the problem</p>