//Load an image and display it in its original size
import java.awt.*;
import java.applet.Applet;
public class TestApplet extends Applet
{
Image nicey;
public void init()
{
setBackground(Color.blue);
String file = "/***/***/jjava/" + "filename.jpg";
nicey = getImage( getDocumentBase(), "filename.jpg" );
}
public void paint(Graphics g)
{
g.drawImage(nicey, 1, 1, this);
}
}
here is my TestApplet.html code:
<HTML>
<HEAD>
</TITLE>TEST APPLET</TITLE>
</HEAD>
<BODY>
Here is an applet
<P>
<APPLET code="TestApplet.class" width=800 height=800>
</APPLET>
</P>
</BODY>
</HTML>
Here are the errors I'm receiving
java.lang.UnsatisfiedLinkError: readImage
at
sun.awt.image.JPEGImageDecoder.produceImage(JPEGImageDecoder.java:137)
at
sun.awt.image.InputStreamImageSource.doFetch(InputStreamImageSource.java:265)
at sun.awt.image.ImageFetcher.fetchloop(ImageFetcher.java:151)
at sun.awt.image.ImageFetcher.run(ImageFetcher.java:127)
At this point nothing else happens, the blank applet just sits there.
Can you please help me
Thank you very much!
In the statement
> nicey = getImage( getDocumentBase(), "filename.jpg" );
you're telling getImage() that the image file is in the same directory
as the HTML file. Make sure that is the case. Also, make sure that
the image file is world-readable.
Hope this helps.
- Bugar
On Tue, 05 Jan 1999 00:08:58 -0500, ltsorrillo <ltsor...@erols.com>
wrote: