title: With what changes would it be possible to first generate an animation frame and then execute the next code lines?
body: <p>I want to do is that It first generate the frame(Animator) and then go for next thing for which it is going
  <br><em><strong>Code are here</strong></em></p>
  <pre><code> private void MHbackupActionPerformed(java.awt.event.ActionEvent evt) {                                         
           // TODO add your handling code here:
          
  new Animator().setVisible(true);
  
          String Dfrom =baseadd+&quot;/&quot;+user;
          String Dto = &quot;E:/Backup&quot; ;
         try {
              Dto = GetLine.mainn(baseadd+&quot;/&quot;+user+&quot;/conf.txt&quot;, 3);
            System.out.println(Dto);
             File fl = new File(Dto);
             if(fl.exists()){
              Backup.main(Dfrom, Dto);
          this.requestFocus();
          JLabel label = new JLabel(&quot;Backup saved successfully &quot;);
              label.setFont(new Font(&quot;Arial&quot;, Font.BOLD, 18));
              JOptionPane.showMessageDialog(null,label,&quot;ERROR&quot;,JOptionPane.WARNING_MESSAGE);
             }
             else{
                 JLabel label = new JLabel(&quot;You not fixed any thing for backup so may fix any drive or external hard disk &quot;);
              label.setFont(new Font(&quot;Arial&quot;, Font.BOLD, 18));
              JOptionPane.showMessageDialog(null,label,&quot;ERROR&quot;,JOptionPane.WARNING_MESSAGE);
             }
          
         } catch (IOException ex) {
             JLabel label = new JLabel(&quot;You not fixed any thing for backup so may fix any drive or external hard disk &quot;);
              label.setFont(new Font(&quot;Arial&quot;, Font.BOLD, 18));
              JOptionPane.showMessageDialog(null,label,&quot;ERROR&quot;,JOptionPane.WARNING_MESSAGE);
             //Logger.getLogger(NewMenuH.class.getName()).log(Level.SEVERE, null, ex);
         }
         
      }                                        
  </code></pre>
  <p><em><strong>Animator code are here</strong></em></p>
  <pre><code>public Animator() {
          initComponents();           //jbl is JLabel
          ImageIcon Loading = new ImageIcon(&quot;C:\\Users\\Suthar\\Desktop\\GIF/ajax-loader.gif&quot;);
          jbl.setText(&quot;Loading ....&quot;);
          jbl.setIcon(Loading);
      }
  </code></pre>
  <p>My try is to ... Gif get visible as we clicked over the respective button<br> but is not doing the same thing I generate the Animator Frame Visible but the Gif not Visible and the end thing that are in ButtonAction it get Visible . But i want to be First gif get visible and then go for other things.</p>