How to load image in Applet class in Java?

Java code to load applet with image in it as background

 * Created on 07-2011 Copyright(c) All Rights Reserved.

import java.applet.Applet;
import java.awt.*;

 * Created by
 * Date: 7/18/11
public class ShowImageInApplet extends Applet {
    Image image = null;
    public void init(){
        image = getImage(getDocumentBase(),"demo.jpg");

    public void paint(Graphics graphics){


Please Post Your Comments & Reviews

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.