View Single Post
  #3 (permalink)  
Old 03-08-2008, 08:54 PM
willemjav willemjav is offline
Senior Member
 
Join Date: Dec 2007
Location: Spain
Posts: 318
willemjav is on a distinguished road
I used following method which is, I think, ok (I used URLs before having the same problem).
I did not think yet of going around the problem... that might be a good one
to try out,
thanks willemjav

private Image downloadImage(String filename) {


Image images = getImage(getCodeBase(), "Imagestore/" + filename); //getDocumentBase()
if (images==null)
JOptionPane.showMessageDialog(infoPane, " no file " + filename);

try {
picwidth = images.getWidth(this);
}
catch (Exception e) {
JOptionPane.showMessageDialog(infoPane, "can not get image width " + e);
}
try {
picheight = images.getHeight(this);
}
catch (Exception e) {
JOptionPane.showMessageDialog(infoPane, "can not get image height " + e);
}

return images;
}
Reply With Quote