I made a simple applet in NetBeans which can display 8 JPG images. It uses a CardLayout. I can see the JPG images when I test it in NetBeans, but when I uploaded everything and tested it with FireFox, I see a light gray panel where the first image should be. I see the JLabel in the south region and when I click on each panel the label cycles through each file name but there is never an image. My applet file resides in the default package and I have the JAR and CLASS files in the same place on my web space along with the JPG files. The JApplet loads on the webpage without any errors.
Joined: Aug 10, 2005
If you are loading and running the applet using a server, then the applet must use URLs to get to the image files on the server. How are you loading the images in the applet? You would use getCodeBase() to get the URL of where the applet loaded from and append to that the path to the image file. If the images are in the jar file, use getResourceAsStream() [ August 07, 2008: Message edited by: Norm Radder ]