Java-Repaint

Repaint

The Repaint( ) method is used to repaint the window.

Program

sfdfsd

Program Source

import java.applet.Applet;
import java.awt.Graphics;

public class Javaapp extends Applet {
 
    int i;
 
    public void paint(Graphics g)
    {
        g.drawString("i = "+i, 100, 100);
     
        try{
            Thread.sleep(1000);
        }catch(InterruptedException ex){}
     
        i++;
        repaint();
    }
}

Leave a Comment