ze0001ng 0 Newbie Poster

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.

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.