Requires Free Membership to View
Here is an example of a simple applet:
import java.applet.*;
import java.awt.*;
public class HelloWorldApplet extends Applet
{
public void init()
{
// Called once when the applet is created.
}
public void start()
{
// Called whenever the applet's container (browser page)
// gains the focus.
}
public void stop()
{
// Called whenever the applet's container (browser page)
// loses the focus.
}
public void destroy()
{
// Called once just prior to the applet being destroyed.
}
public void paint(Graphics g)
{
// Called whenever the applet needs to repaint.
g.setColor(Color.black);
g.drawString("Hello world!", 4, 50);
}
}
This was first published in October 2004

Join the conversationComment
Share
Comments
Results
Contribute to the conversation