title: JTextField is not working as expected in Netbeans IDE
body: <p>I have one Class named <code>MainFrem</code></p>
  
  <pre><code>public class MainFrem extends javax.swing.JFrame {
  
      public MainFrem() {
          initComponents();
  
      }
  
      @SuppressWarnings("unchecked")
      // &lt;editor-fold defaultstate="collapsed" desc="Generated Code"&gt;                          
      private void initComponents() {
  
          ok = new javax.swing.JButton();
  
          setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  
          ok.setText("ok");
          ok.addActionListener(new java.awt.event.ActionListener() {
              public void actionPerformed(java.awt.event.ActionEvent evt) {
                  okActionPerformed(evt);
              }
          });
  
          javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
          getContentPane().setLayout(layout);
          layout.setHorizontalGroup(
              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(layout.createSequentialGroup()
                  .addGap(74, 74, 74)
                  .addComponent(ok)
                  .addContainerGap(144, Short.MAX_VALUE))
          );
          layout.setVerticalGroup(
              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(layout.createSequentialGroup()
                  .addGap(62, 62, 62)
                  .addComponent(ok)
                  .addContainerGap(70, Short.MAX_VALUE))
          );
  
          pack();
      }// &lt;/editor-fold&gt;                        
  
      private void okActionPerformed(java.awt.event.ActionEvent evt) {                                   
          new SecondClass().setVisible(true);
          System.out.println("Ok button Pressed.");
          new SecondClass().FeelIn.setText("Operation Successful.");
  
      }                                  
  
      public static void main(String args[]) {
          java.awt.EventQueue.invokeLater(new Runnable() {
              public void run() {
                  new MainFrem().setVisible(true);
              }
          });
      }
  
      // Variables declaration - do not modify                     
      private javax.swing.JButton ok;
      // End of variables declaration                   
  }
  </code></pre>
  
  <p>And the Second Class is </p>
  
  <pre><code>public class SecondClass extends javax.swing.JFrame {
      public SecondClass() {
          initComponents();
      }
      @SuppressWarnings("unchecked")
      // &lt;editor-fold defaultstate="collapsed" desc="Generated Code"&gt;                          
      private void initComponents() {
  
          FeelIn = new javax.swing.JTextField();
  
          setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
  
          javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
          getContentPane().setLayout(layout);
          layout.setHorizontalGroup(
              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(layout.createSequentialGroup()
                  .addGap(48, 48, 48)
                  .addComponent(FeelIn, javax.swing.GroupLayout.PREFERRED_SIZE, 67, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addContainerGap(62, Short.MAX_VALUE))
          );
          layout.setVerticalGroup(
              layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
              .addGroup(layout.createSequentialGroup()
                  .addGap(29, 29, 29)
                  .addComponent(FeelIn, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                  .addContainerGap(53, Short.MAX_VALUE))
          );
  
          pack();
      }// &lt;/editor-fold&gt;                        
      public static void main(String args[]) {
          java.awt.EventQueue.invokeLater(new Runnable() {
              public void run() {
                  new SecondClass().setVisible(true);
              }
          });
      }
  
      // Variables declaration - do not modify                     
      public javax.swing.JTextField FeelIn;
      // End of variables declaration                   
  }
  </code></pre>
  
  <p>I am using NetBeans IDE and most of the code is generated by the IDE. in the class named <code>Mainfrem</code>  I wrote the code below and this is the only code is written in the two class by me. </p>
  
  <pre><code>private void okActionPerformed(java.awt.event.ActionEvent evt) {                                   
      new SecondClass().setVisible(true);
      System.out.println("Ok button Pressed.");
      new SecondClass().FeelIn.setText("Operation Successful.");
  
  }
  </code></pre>
  
  <p>In the class named <code>MainFrem</code> I take a JButton and set the Action Listener like as show above, and in class named <code>SecondClass</code> I just add a JTextField named <code>FeelIn</code>. I am trying to press the <code>ok</code> button in the class<code>MainFrem</code> and change the JTextField in the <code>SecondClass</code> as <code>Operation Successful.</code>. The JTextField in the <code>SecondClass</code> is not changing to <code>Operation Successful</code> Is there a way to solve the problem. </p>