title: Animation in GIF not working when processing is going on
body: <p>I am displaying a GIF animation using the following code:   </p>
  
  <pre><code>    ImageIcon ii = new ImageIcon(getClass().getResource("resources/wait_animated.gif"));
              JLabel l2 = new JLabel("Please Wait...",ii, SwingConstants.CENTER);
          ii.setImageObserver(l2);
          d.setIconImage(null);
          JDesktopPane dp=new JDesktopPane();
          dp.setPreferredSize(new Dimension(300,50));
  
          l2.setLocation(dp.getX(),dp.getY());
          l2.setPreferredSize(new Dimension(300,50));
  
          d.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
          d.setTitle("Wait dialog");
  
          d.add(l2);
          JDialog.setDefaultLookAndFeelDecorated(true);
          d.pack();
          d.setPreferredSize(new Dimension(50,50));
          d.setLocation(300,300);
          d.setAlwaysOnTop(true);
          d.setVisible(true);
  </code></pre>
  
  <p>The animation in GIF is displayed quite well. However, when there is some processing to be done after this ( i am using the wait dialog when database updation is going on ) ; the animation hangs. Can someone suggest a simple &amp; effective way of achieving this? 
  The simpler the better for me.
  Thanks in advance</p>