title: How to pass JTextField from JFrame into another JFrame
body: <p>When I input First Name, Last Name and other information in the <code>JTextField</code> of <code>JFrame1</code>
  and then click button next, the inputted data will display all inputted data on last <code>JFrame</code>.<br>
  Example: this is animated gif, the last frame is what I want, cause I still don't know how to make it:</p>
  
  <p><img src="https://i.stack.imgur.com/W87KQ.gif" alt="enter image description here"></p>
  
  <p>How can I do this? I'm sorry if this is a newbie question but I'm learning..</p>
  
  <p>I am using NetBeans GUI builder.</p>
  
  <p>EDIT:
  I created like this idk if i'm doing it right...</p>
  
  <pre><code>public class User {
      private String username;
      private String password;
      public User() {
          username = null;
          password = null;
      }
  
      public User getUser() {
          User user = new User();
          username = TexUsername.getText();
          return user;
      }
  }
  </code></pre>
  
  <p>and in my DisplayFrame is i don't know what put inside</p>
  
  <pre><code>public void setUser(User user) {
      // idk what to put here... maybe the jLabel? please help
  }
  </code></pre>
  
  <p><strong>NEW UPDATES ON QUESTION</strong></p>
  
  <p>the button on my <code>StudentRegistrationForm_1.java</code></p>
  
  <pre><code>private void jButton_NextActionPerformed(java.awt.event.ActionEvent evt) {                                             
      try {
          User user = new User(TexUsername.getText(),Password.getPassword());
          StudentRegistrationForm_3 form = new StudentRegistrationForm_3(user);
          form.setUser(user);
          this.dispose();
      } catch(Exception e){JOptionPane.showMessageDialog(null, e);}
      /*
      new StudentRegistrationForm_2().setVisible(true);
      this.dispose();*/
  
  } 
  </code></pre>
  
  <p>and the class</p>
  
  <pre><code>public class User {
  
      private String name;
      private char[] password;
  
      public User(String name, char[] password) {
          this.name = name;
          this.password = password;
      }
  
      public String getName() {
          return name;
      }
  
      public char[] getPassword() {
          return password;
      }
  }
  
  public User getUser() {
      User user = new User(TexUsername.getText(), Password.getPassword());
      return user;
  }
  </code></pre>
  
  <p>while the <code>StudentRegistrationForm_3</code>
  I added a constructor and method like this</p>
  
  <pre><code>StudentRegistrationForm_3(User user) {
      name.setText(user.getName());
  }
  public void setUser(User user) {
      name.setText(user.getName());
  }  
  </code></pre>
  
  <p>idk why still gave me null... even I input the value on username and password..</p>