Applet Image Missing
Hello again Stackoverflow members, The CatchTheCreature Applet class is supposed to display an image being repainted in different locations by a time delay, but for some reason the
Solution 1:
..image = new ImageIcon("Monster.png");
- The
Stringbased constructor toImageIconpresumes theStringto represent aFile. - A sand-boxed applet cannot access
Fileobjects, but can accessURLs coming from the same code base/document base. - Use
getDocumentBase()/getCodeBase()with an relative path to the image, and the applet will be portable (assuming the image is also uploaded to the same place).
Post a Comment for "Applet Image Missing"