Java-Repeated Execution of Start and Paint

Repeated Execution of Start and Paint

The init() method to be executed only once. But the start() method called every time whenever the execution of an applet is to be resumed.

Program

yguj

Prorgam Source

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

public class Javaapp extends Applet {
    
    String str = "";
    
    public void init()
    {
        str+="-init-";
    }
    
    public void start()
    {
        str+="-start-";
    }
    
    public void paint(Graphics g)
    {
        g.drawString(str, 100, 100);
    }
}

Leave a Comment