Their java kamrades

following method won´t work because
Img.getWidth(null); gives -1 (also getheight)
Images are present and do load but won´t
show there sizes why?

willemjav

private Image scaleDownloadImage(String filename) { //downloads image
ClassLoader cl = Imagean.class.getClassLoader();
URL imageURL = cl.getResource(filename);
Image Img=null;
if (imageURL != null) {

Img = Toolkit.getDefaultToolkit().createImage(imageURL);
}
else {
JOptionPane.showMessageDialog(infoPane,
"The file " + filename + " is not present");
if (files == null)
JOptionPane.showMessageDialog(infoPane,
"No fallid image files present in " + filename);
Img= testimage;
}
imgwidth = Img.getWidth(null);
imgheight = Img.getHeight(null);
Img = scaleImage(Img); // scale each downloaded image
return Img;
}