title: how to save data into notepad from java
body: <p>hello everyone im trying to save data in the notepad but i dont know how to save many lines. with this code i just can save once the data.</p>
  
  <pre><code>package Vista;
  import java.io.BufferedWriter;
  import java.io.File;
  import java.io.FileWriter;
  import java.io.IOException;
  import java.io.PrintWriter;
  
  public class notepad_Data {
  
      public void escribir(String nombreArchivo) { 
  
              File f; 
              f = new File("save_data");                    
                    try {            
                      FileWriter w = new FileWriter(f);
                      BufferedWriter bw = new BufferedWriter(w);
                      PrintWriter wr = new PrintWriter(bw);
                      wr.append(nombreArchivo+" ");               
                      bw.close();
  
                  } catch (IOException e) {
                  };                
  
      }
      public static void main(String[] args){    
          notepad_Data obj = new notepad_Data();
          obj.escribir("writing in the notepad");
      }
  }
  </code></pre>
  
  <p>i tried with this code in the escribir method but doesnt work</p>
  
  <pre><code> for(int i=0; i&lt;1000; ++i){           
                    try {            
                      FileWriter w = new FileWriter(f);
                      BufferedWriter bw = new BufferedWriter(w);
                      PrintWriter wr = new PrintWriter(bw);
                      wr.append(nombreArchivo+" ");               
                      bw.close();
  
                  } catch (IOException e) {
                  };
                }
  </code></pre>