I tried Applet.getCodeBase() but this just caused the program to crash when
the code was run. It gave the following error:
java.lang.NullPointerException at java.applet.Applet.getCodeBase(Unknown
Source)
Any help would be appreciated.
Thanks.
Instead of getCodeBase() you could try getDocumentBase(). I have not
tried this myself but i'm sure its worth a try:
Returns an absolute URL naming the directory of the document in which
the applet is embedded. For example, suppose an applet is contained
within the document:
http://www.fahdshariff.cjb.net/projects/applet.html
The document base is:
http://www.fahdshariff.cjb.net/projects/
I'm curious to know if it works!
"DaveS" <daj...@york.ac.uk> wrote in message news:<amtbpa$3at$1...@pump1.york.ac.uk>...
How about:
File myDir = new File( "." );
String fullPath = myDir.getCanonicalPath();
/* getCanonicalPath() may throw an IOException, so you have to catch or
reflect it */
David Patterson
patt...@comcast.net