954,506 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Help: applet can not find image files

Hello, skillers,
I have an applet that needs to use image files to create Image. However, when loaded by web-browser, the applet can not find the image files but it works perfectly fine by using appletviewer. Here is the code for defining the applet:

<applet archive="applet.jar" width="600"
                      height="630" code="board.Player0.class">
                     <param name="name" value="myName"/>

and in the Applet class, I use the following method to create Image:

Image northWestCorner = tk.createImage("images/top_left.png");

where tk is a instance of java.awt.Toolkit class.

the applet.jar file and the images files are all located in the same directory as the HTMl file. But the applet can not find the images when loaded with web browser.

I am wondering I may need to set the working directory for the applet or the web application but do not know how.
Could any body help me out?

Thanks very very much.

ze0001ng
Newbie Poster
3 posts since May 2008
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You