title: Deleting data from a txt file in GUI
body: <p>I am creating my first GUI its a phonebook where users can add, show all, and delete contacts stored in a txt file. My problem here is I'm already able to write the datas to the txt file but I dont know to how delete a contact. Sorry guys newbee here.
  This is how I put the data in a txt file and read it back.</p>
  
  <pre><code>private void ADD_ActionPerformed(java.awt.event.ActionEvent evt) {                                     
          inputs ++;
          String[] name;
          String[] number;
          String[] email;
          name   = new String[inputs];
          number = new String[inputs];
          email  = new String[inputs];
      //arrays the inputs
  
      for (int i = 0; i &lt; inputs; i++) {
          name  [i] = name_field.getText();
          number[i] = number_field.getText();
          email [i] = email_field.getText();
      }
       name_field.setText("");
       number_field.setText("");
       email_field.setText("");
  
       try (PrintWriter write = new PrintWriter(new BufferedWriter(new FileWriter("database.txt", true)))){
  
          for (int i = 0; i &lt; 1; i++) {
              write.write("Name: "+name[i] + "\nNumber: " + number[i] + "\nEmail: " + email[i] +"\n\n");
          }
  
      } catch (IOException e) {
          System.err.println("ERROR");
      }        
  
  }                                    
  
  private void SHOW_ActionPerformed(java.awt.event.ActionEvent evt) {                                      
      try {
          File f = new File("database.txt");
          Scanner sc = new Scanner(f);
          while (sc.hasNextLine()) {
  
              String data = sc.nextLine();
  
              contact_area.append("\n " + data); 
  
          }
  
      } catch (IOException e) {
          System.out.println("ERROR");
      }        
  
  }                                     
  
  private void DELETE_ActionPerformed(java.awt.event.ActionEvent evt) {                                        
  
  // :( i dunno how to start
  
  }  
  </code></pre>