Hello
I am trying to do a simple java applet which loads image from a specified url.
Here is the code I have now, but it cant seem to work.
When i compiled the program, there was no errors, but the applet doesnt load the image. The URL specified is correct; it can be loaded in the web browser.
What might be the problem?
Thank you for your help.
I am trying to do a simple java applet which loads image from a specified url.
Here is the code I have now, but it cant seem to work.
Code:
import java.applet.*;
import java.awt.*;
public class ATestofLoadImage extends Applet {
Image image;
public void init() {
// Load image
image = getImage(getDocumentBase(), "http://127.0.0.1:8550/epe/map/render?name=Tag%201");
}
public void paint(Graphics g) {
// Draw image
g.drawImage(image, 0, 0, this);
}
}
What might be the problem?
Thank you for your help.
Comment