title: How to clear Jtextfields on reopen after disposing the frame at first time
body: <p>I am trying to make a program consisting of two frames. In the first frame, when pressing the button, the second jframe opens. After giving some input in the Jtextfield of second frame, when I reopen it after disposing this, the Jtextfield contains the input which was entered previously. I am trying to make the Jtextfield clear or null when I open the frame again. The value which was entered previously will remain in the Jtextfield even after disposing and opening the Jframe again.
  Here is my code.</p>
  
  <p>1st Frame:</p>
  
  <pre><code>package hotel_crown;
  
  public class Main extends javax.swing.JFrame {
  
  public Main() {
  
      initComponents();
  
  }
  search_guests sr=new search_guests();
  
  private void btn_srch_gstActionPerformed(java.awt.event.ActionEvent evt) {                                             
  
      sr.setVisible(true);        
  }                                            
  </code></pre>
  
  <p>2nd Frame:</p>
  
  <pre><code>package hotel_crown;
  
  public class search_guests extends javax.swing.JFrame {
  
  public search_guests() {
      initComponents();
      remove();
  }
  
  private void remove()
  {
      txt_cnic.setText(null);
      txt_nam.setText(null);
      txt_phone.setText(null);
  }
  </code></pre>