How to get Applet's document URL?
The code snippet below show you how to get the URL of the document (HTML, JSP, etc) where the Applet is embedded. To obtain this document URL we use the
getDocumentBase() method call provided by the
paint() method below we use the
getDocumentBase() to create a URL as a link to an image to be displayed by our applet.