title: converting many line in text area to txt file
body: <p>how can I convert the text area to txt file but with the same format, because I try to convert it to txt file, but the output on the txt file is just a long line instead on many lines just like on the text area.</p>
  
  <p><a href="https://i.stack.imgur.com/r8oHZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r8oHZ.png" alt="enter image description here"></a></p>
  
  <p>here is the output:
  <a href="https://i.stack.imgur.com/K9VJB.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/K9VJB.png" alt="enter image description here"></a></p>
  
  <p>here is my code:</p>
  
  <pre><code>private void convertToTxtActionPerformed(java.awt.event.ActionEvent evt) {                                             
      //////not included on the generated datalogs///
      String lastDevice = jLastDevice.getText(); 
      String progname = jProgramName.getText();
      String progRev = jProgramRevision.getText();
      /////////////////////////////////////////////
      String boardname = jBoardname.getText();
      String pn = jPN.getText();
      String sn = jSN.getText();
      String boardrev = jBoardRev.getText();
      String verifStatus = jVerificationStatus.getText();
      String failedTNum = jFailedTNum.getText();
      String checker = jFailingChecker.getText();
      String tester = jTesterNumber.getText();
      String remarks = jRemarks.getText();
      String verifiedBy = jVerifiedBy.getText();
      //String dLogs = jDatalog.getText();
  
       try{
              File file = new File("\\\\ets88-spare\\e\\Data Logs\\ " + sn + "_" + verifStatus + ".txt");
              if(!file.exists()){
                  file.createNewFile();
              }
              FileWriter fw = new FileWriter(file.getAbsoluteFile());
              BufferedWriter bw = new BufferedWriter(fw);
              bw.write("Board Name                : " + boardname);
              bw.newLine();
              bw.write("Part Number               : " + pn);
              bw.newLine();
              bw.write("Serial Number             : " + sn);
              bw.newLine();
              bw.write("Board Revision            : " + boardrev);
              bw.newLine();
              bw.write("Failing Test Parameter    : " + failedTNum);
              bw.newLine();
              bw.write("Failing Checker           : " + checker);
              bw.newLine();
              bw.write("Verified By               : " + verifiedBy);
              bw.newLine();
              bw.write("Remakrs                   : " + remarks);
              bw.newLine();
              bw.write("Tester Number             : " + tester);
              bw.newLine();
              bw.write("**************************************************************************************");
              bw.newLine();
              bw.write("*                                    Datalog                                         *");
              bw.newLine();
              bw.write("**************************************************************************************");
              bw.newLine();
              bw.newLine();
              for (String dLogs : jDatalog.getText().split("\\n")){ 
              bw.write(dLogs);
              System.out.println(dLogs);
              }
              bw.close();
              String note = boardname.concat(" with ").concat(sn).concat(" is located on 'ETS88-spare'\'E:'\'Data Logs'"); //" with " + sn " is located on 'EData Logs'"
              JOptionPane.showMessageDialog(null, note);
              //System.out.println(note);
          }catch(IOException | HeadlessException e) {
              JOptionPane.showMessageDialog(null, e);
          }
  
  
  }                                 
  </code></pre>