Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.
Java getImage()
Ok I did what spyware's link showed and it doesn't give me an error anymore, it just doesn't load an image at all
try{
LoadMyImage("http://www.google.co.uk/intl/en_uk/images/logo.gif");
} catch (MalformedURLException e){
// Do nothing
}
}
public void LoadMyImage(String ur) throws MalformedURLException {
u = new URL(ur);
Image img1 = getImage(u);
repaint();
}```
There's my code, does anyone see any errors?
x_5631 wrote: Ok I did what spyware's link showed and it doesn't give me an error anymore, it just doesn't load an image at all
try{
LoadMyImage("http://www.google.co.uk/intl/en_uk/images/logo.gif");
} catch (MalformedURLException e){
// Do nothing
}
}
public void LoadMyImage(String ur) throws MalformedURLException {
u = new URL(ur);
Image img1 = getImage(u);
repaint();
}```
There's my code, does anyone see any errors?
it's not that it isnt giving an error anymore, it is just catching the error and then it does nothing. this code doesnt solve the problem, it just handles the situation differently if the problem arises.
try{
LoadMyImage("http://www.google.co.uk/intl/en_uk/images/logo.gif");
} catch (MalformedURLException e){
//if you were to put something in here it wouldnt do nothing
}