title: drawImage() with using BufferedImage doesn't draw
body: <pre><code>import java.awt.*;
  import java.awt.image.BufferedImage;
  import javax.swing.*;
  
  public class Main
  {
      JFrame jf;
      Main()
      {
          jf=new JFrame();
          jf.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          jf.add(new MyCanvas());
          jf.pack();
          jf.setVisible(true);
      }
      public static void main(String[] args)
      {
          MyCanvas.img=Toolkit.getDefaultToolkit().createImage("1.jpg");
          SwingUtilities.invokeLater(new Runnable()
          {
              @Override
              public void run()
              {
                  new Main();
              }
          });
      }
  }
  class MyCanvas extends JComponent
  {
      static Image img;
      BufferedImage bi;
      MyCanvas()
      {
          setPreferredSize(new Dimension(200,200));
          bi=new BufferedImage(200,200,BufferedImage.TYPE_INT_ARGB);
          Graphics g=bi.getGraphics();
          for (int i=0;i&lt;10;i++)
              for (int j=0;j&lt;10;j++)
                  g.drawImage(img,i*20,j*20,20,20,this);
      }
      public void paintComponent(Graphics g)
      {
          super.paintComponent(g);
          g.drawImage(bi,0,0,this);
          //g.drawImage(img,0,0,this);
      }
  }
  </code></pre>
  
  <p>If I uncomment line <code>g.drawImage(img,0,0,this);</code> I get my image on window. But with this code I see empty window. It is easy to understand that <code>g.drawImage(img,i*20,j*20,20,20,this);</code> in loop doesn't draw but what is problem?</p>