Hi, I’m having a really strange problem. I’m making an applet that loads about 20 small images(32x32 or 64x64) with ImageIO.
This works fine in eclipse (the applet takes about 0.3 seconds to load the images), but when I export it to a jar and run it on my website, the applet takes 30 seconds to load just the images.
The total size of all the images is 160kb. I am on broadband and can download at 1.2mb/s and my webhost isn’t that slow either.
Can anyone help me with this?
Thanks,
roland
public BufferedImage LoadImage(String str)
{
System.out.println("loading " + str);
BufferedImage bf = null;
URL url = null;
try
{
url = new URL(codebase, str);
}
catch (Exception e) {}
BufferedImage image = null;
try
{
image = ImageIO.read(url);
}
catch (IOException e)
{
System.out.println("error");
}
if (image == null)
return null;
bf = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_INT_ARGB);
bf.getGraphics().drawImage(image, 0, 0,bf.getWidth(),bf.getHeight(), null);
return bf;
}