title: java how to set the text of a label in a JFRAME (parent form) , from a JPANEL(child form)
body: <p>This is better i think. why label text is not changing?
  The main class is in NewJFrame form</p>
  
  <pre><code>public class NewJFrame extends javax.swing.JFrame {
          public NewJFrame() {
              initComponents();
              NewJPanel jpanel = new NewJPanel();
              anotherPanel.add(jpanel);
           //there is also a label in this frame outside of the anotherPanel
          }
      }
  </code></pre>
  
  <p>This is a JPanel form. i am adding this jpanel into NewJFrame (anotherPanel)</p>
  
  <pre><code>public class NewJPanel extends javax.swing.JPanel {
          public NewJFrame newJFrame;
              public NewJPanel() {
                  initComponents();
                  this.setSize(200, 200);
          //there is a button here
              }
     private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
                  this.newJFrame = newJFrame;
        newJFrame.jLabel1.setText("Need To change the text from here"); // this is not working, text is not changing
              }
          }
  </code></pre>