NiceButDim
Programmer
Hi,
I have an image that I am loading and displaying on my applet. I have a problem in that the image does not appear when the applet is first run. If you refresh the applet (i.e. hide then unhide the window) the image is there. It appears that I have to leave time for the image to fully load before drawing because I have found that after loading, if I add the following code;
while(image.getWidth()==-1);
all is well. Although this solves my problem I would assume that it is not the ‘correct’ way to deal with this ‘problem’.
I would be grateful for any pointers on how I should deal with this issue.
Thanks.
I have an image that I am loading and displaying on my applet. I have a problem in that the image does not appear when the applet is first run. If you refresh the applet (i.e. hide then unhide the window) the image is there. It appears that I have to leave time for the image to fully load before drawing because I have found that after loading, if I add the following code;
while(image.getWidth()==-1);
all is well. Although this solves my problem I would assume that it is not the ‘correct’ way to deal with this ‘problem’.
I would be grateful for any pointers on how I should deal with this issue.
Thanks.