Click to See Complete Forum and Search --> : URGENT!!!! - getImage(URL) function


dcturner
September 24th, 1999, 07:55 AM
The getImage(URL) function is a class member of java.applet.Applet. However, what I need is an equivalent function to load an image from the internet without having to descend the control which is displaying the image from java.applet.Applet - the control in question is descended from java.awt.Canvas at the moment.

Please help!

Dave Turner

Leon
September 24th, 1999, 08:44 AM
man, write your own ImageLoader class, that uses the applet's function getImage!
add a static method to your applet class, that returns reference to this class
add method getImage to your ImageLoader class
and you can load images from whereever you want without havin reference to the applet class

I hope you can manage that!

Leon
http://people.bulgaria.com/vleonkev

poochi
September 24th, 1999, 09:18 AM
There is another version of getImage in toolkit.

Try,

getToolkit().getImage( url );

I am not sure whether it will work or not. Just give a try.