hi I'm facing a problem with ImageIcon. In my applet, I'm trying to read images from a zip file on the server. The image objects are read and created correctly, but the ImageIcon objects which I make from the Image objects are null. The interesting part is that this is happening only when I run the applet from my office computer. When I run it from home, the ImageIcon objects are not null and displayed correctly. The code is shown below. Please advise.
Thank you
Vidya
public static Hashtable getImageTableFromZip(String zipFileName)
{
Hashtable imageTable=new Hashtable();
ZipInputStream zipIn;
try
{
String zipFilePath=Environment.getInstance().getImageZipUrl ();
URL url = new URL(zipFilePath+zipFileName);
InputStream in = url.openConnection().getInputStream();
BufferedInputStream bufIn = new BufferedInputStream(in);
zipIn = new ZipInputStream(bufIn);
ZipEntry zipEntry;
while((zipEntry = zipIn.getNextEntry()) != null)
{
Image image=extractImageFromZip(zipIn);
ImageIcon imageIcon=new ImageIcon(image);
System.out.println ("image is "+image +" imageicon made from image is "+imageIcon);
imageTable.put(zipEntry.getName(),imageIcon);
}
}catch(Exception e){e.printStackTrace(); }
return imageTable;
}