title: using of Swingworker giving incorrect results
body: <p>My project follows the following flow:
  <img src="https://i.stack.imgur.com/siCFB.png" alt="enter image description here"></p>
  
  <p>I want to use swingworker.Here is the way i am using it but the results are not coming correct</p>
  
  <p>In my GUI code, my code is this for executing the principal class</p>
  
  <p>I have written the following lines of code in buttons code</p>
  
  <pre><code>     Main f2 = new Main();
  
      f2.execute();
  </code></pre>
  
  <p>In my Principal class ,i have done this</p>
  
  <pre><code>      class Principalclass extends SwingWorker&lt;Void, Void&gt;
            {
              @Override
              public Void doInBackground() throws IOException 
               {
                 //while loop
                }
             @Override
              public void done() {
                System.out.println("I am DONE");
                GUI b = new GUI();   
                b.ShowFrame();   //calls the function of the GUI to display frame
               }
  </code></pre>
  
  <p>Now this code without printing "I am DONe" displays the GUI frame.I am confused if i have to do some changes in classes 2,3 and 4 bcz i am using swingworker or if i have to do further changes only in Principalclass.Secondly,the application which should take 15 mins to complete its task,it just takes 2 secs :(.May be i am doing something seriously wrong because i am using swing worker for the first time.</p>