Check the getImage(URL url, String name) method in the Applet api to see that the name must be relative to the url. When you fix this you run into file permission problems. Another approach is to move the image file into/onto your class path and let the class loader find it with the getResource method which is introduced in How to Use Icons (see "Loading Images Using getResource" and "Loading Images Into Applets"). You discovered the other way: load the image in another class using Toolkit/MediaTracker, ImageIcon or ImageIO loading methods.
posted 14 years ago
Hi Craig, Excellent.It works well for me.Thanks for the coding.