title: Using JFrame to display an image through a loop
body: <p>I have a recursive loop that performs calculations on an image and want to display the progress of the image through each iteration. </p>
  
  <p>This is what I have:</p>
  
  <pre><code>static JFrame colFrame = new JFrame();
  main() {}
  
  loop() {
  
          JLabel label = null;
          ImageIcon colIcon = new ImageIcon(blockImg);
          label = new JLabel(colIcon);
          colFrame.getContentPane().add(label);
          colFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); // close canvas once the window is closed
          colFrame.pack();
          colFrame.setVisible(true);
  
  }
  </code></pre>
  
  <p>Does anyone know how to change my code so that it will display the image through each iteration? </p>