I would like to download images in a java applet, for displaying at any given time - i.e. getting the image from the server into an Image variable which can then be added to a Canvas or something similar.
I've experimented with getImage and MediaTracker, as in the code below, but am getting NullPointerException returned when it comes to adding the Image to the canvas.
In the code below, iCanvas is a class which adds the image object to an array and then draws all stored ones.
Any ideas (or a better way to do this)?
MediaTracker mt=new MediaTracker(this);
iCanvas.addimagetodisplay(spl,0,0); //Null pointer exception at this line