Hai, I'm trying to load an image using applet.but i didn't get the image.
The applet screen was an empty,it shows at the status bar "Start: Applet not initialized" .
I don't know how to get a image.pls somebody help me.the codes following


------------------------------------------------------------------------------------

/*<applet code="crim1.class" height=500 width=500>
<param name="img" value="Sunset.jpg"></applet>*/

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


class crim1 extends Applet
{
Image img;
public void init()
{
img=getImage(getDocumentBase(), getParameter("img"));
}
public void paint(Graphics g)
{
g.drawImage(img,0,0,this);

}
}

--------------------------------------------------------------------------------------

Recommended Answers

All 2 Replies

Hai, I'm trying to load an image using applet.but i didn't get the image.
The applet screen was an empty,it shows at the status bar "Start: Applet not initialized" .
I don't know how to get a image.pls somebody help me.the codes following


------------------------------------------------------------------------------------

/*<applet code="crim1.class" height=500 width=500>
<param name="img" value="Sunset.jpg"></applet>*/

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


class crim1 extends Applet
{
Image img;
public void init()
{
img=getImage(getDocumentBase(), getParameter("img"));
}
public void paint(Graphics g)
{
g.drawImage(img,0,0,this);

}
}

-----------------------------------------------------------------------------------

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.