Alright so I'm trying to read an Image from a URL and it's not really doing anything. Here is the method I am using to retrieve an image from a URL:
public Image getImage(String url){
try{
System.out.println("gettingImage");
return ImageIO.read(new URL(url));
}catch(Exception e){
e.printStackTrace();
return null;
}
}
I've added in a System.out.println() just to make sure that the method was actually executing when I called it.
The url I'm passing in to it is: http://i3.kym-cdn.com/photos/images/masonry/000/349/917/065.png (which is a valid url)
My output is this:
gettingImage
It just says 'gettingImage' (from the System.out.println() I've added) and doesn't actually get the image for some reason. There is no stacktrace, just that output. Any help would be greatly appreciated. Thanks.