Better way to load images in Applets?
Hi. I want to know if there is a better more OOP way of loading images in an applet. So far the only way I know how to load images in an applet is to do the following
In the Applet class,
URL base = getDocumentBase();
Image img = getImage(base,"blah.gif");
getImage is a member function of the Applet class. I want other classes to be able to load images as well. I don't want to extend all my other classes as applets and I don't want to pass an applet reference around to my classes either as this seems rather cumbersome and will become quite convoluted. Is there a better way of doing it? Thanks in advance!
# 1 Re: Better way to load images in Applets?
See the Java Tutorial - Working With Images (http://java.sun.com/docs/books/tutorial/2d/images/index.html), in particular Reading/Loading An Image (http://java.sun.com/docs/books/tutorial/2d/images/loadimage.html).
Bear in mind that applets are severely restricted as to what external resources they can access.
One can think effectively only when one is willing to endure suspense and to undergo the trouble of searching...
J. Dewey
dlorde at 2007-11-10 2:14:45 >

# 3 Re: Better way to load images in Applets?
"Not believing doesn't make something not true"
Oh good grief... :rolleyes:
Faith is believing what you know ain't so...
Mark Twain
dlorde at 2007-11-10 2:16:50 >
