Loading an Image with Java Applet

import java.awt.*;
import java.applet.*;
/*
 * <applet code="image" width=300 height=150
 * <param name="img" value="cover.jpeg">
 * </applet>
 */
public class image extends Applet
{
    Image img;
    public void init()
    {
        img=getImage(getDocumentBase(),getParameter("img"));
    }
    public void paint(Graphics g)
    {
        g.drawImage(img,10,20,this);
    }
}

Top