title: Delay is not working in java graphics
body: <p>This is a code for drawing points on calculated locations by Bresenham's algorithm: </p>
  
  <pre><code>public void drawBresenhamPoints(Graphics2D g2, List&lt;Point&gt; bresenham) throws InterruptedException
  {
         Graphics2D g = (Graphics2D) g2;
  
      if(bresenham == null)
          return;
  
      g.setColor(Color.DARK_GRAY);
  
      for(int i = 0; i &lt; bresenham.size(); i = i+20)
      {
          int x = bresenham.get(i).x - pointWidth1/2;
          int y = bresenham.get(i).y - pointWidth1/2;
  
          int ovalW = pointWidth1;
          int ovalH = pointWidth1;
  
          g.fillOval(x, y, ovalW, ovalH);
  
              // delay
           try 
           {
               Thread.sleep(10);
           } 
           catch(Throwable e) 
           {
           System.out.println(e.getMessage()); 
           }
      }
  }
  </code></pre>
  
  <p>The list 'bresenham' contains all the points which are pre-calculated with the help of Bresenham's line drawing algorithm.  I want to set a delay of 1 second inside the 'for' loop so that each and every point is drawn after an interval of 1 second. The portion listed in the 'delay' section doesn't work. How to make 'delay' work?
      More specifically, I want to see all the points being drawn one by one on the screen in an interval of 1 second.</p>