title: How to see communicate between 2 runnable with progression
body: <p>I have 2 classes .java</p>
  
  <p>The main :</p>
  
  <pre><code>public class Controller extends javax.swing.JFrame
  {   
      public static void updateProgressBar(int i) {
          jProgressBar1.setValue(i);
          jProgressBar1.repaint();
      }
  
      public static void main(String args[]) {
  
          /* Create and display the form */
          java.awt.EventQueue.invokeLater(new Runnable() {
              public void run() {
                  Controller app = new Controller();
                  app.setVisible(true);
                  app.setResizable(false);
              }
          });
      }
  
      private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
          ChildModel model = new ChildModel();
          Thread t1 = new Thread(model);
          t1.start();
      }
  
      private javax.swing.JProgressBar jProgressBar1; //Initialized with Netbeans builder
  }
  </code></pre>
  
  <p>My ChildModel (ChildModel.java) computes some code (that takes around 10-20 sec) and I want to show the progress on the father class (Controller.java).</p>
  
  <p>Here is my ChildModel :</p>
  
  <pre><code>public class ChildModel implements Runnable
  {
      public ChildModel(){ /* Something */ }
  
      public void complexMath()
      {
          //Lots of logic here
          Controller.updateProgression(purcent);
      }
  
      @Override
      public void run() {
          complexMath();
      }
  }
  </code></pre>
  
  <p>The problem is obviously my static void updateProgressBar that cannot modify a non-static variable. How can I accomplish this ?</p>