Java for loop bug
     	Image probe;

	Thread t;
	public int x=410,y=250;
    
        
    	public void init()
    	{
    		
    		//Images Call
    		probe = getImage(getDocumentBase(),"image/probe.png");
    		
    		t = new Thread();
    	
    
    	
    	}
    
       for(int i=0;i<5;i++)
    			{
    				g.drawImage(probe,x,y,50,50,this);
    				g.setColor(Color.red);
    				x=x+10;
    				y=y+10;
    				repaint();
    				
    				try
    				{
    				t.sleep(100);
    				}
    				catch(Exception e)
    				{}
    			}

So in this it should do my for loop 5 times correct? but instead it does it over and over and over and never stops when i want it to just move 5 times then stop.
Java for loop bug
===

     	Image probe;

	Thread t;
	public int x=410,y=250;
    
        
    	public void init()
    	{
    		
    		//Images Call
    		probe = getImage(getDocumentBase(),"image/probe.png");
    		
    		t = new Thread();
    	
    
    	
    	}
    
       for(int i=0;i<5;i++)
    			{
    				g.drawImage(probe,x,y,50,50,this);
    				g.setColor(Color.red);
    				x=x+10;
    				y=y+10;
    				repaint();
    				
    				try
    				{
    				t.sleep(100);
    				}
    				catch(Exception e)
    				{}
    			}

So in this it should do my for loop 5 times correct? but instead it does it over and over and over and never stops when i want it to just move 5 times then stop.