Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

need help with passing URL of document into Applet

797160Feb 15 2011 — edited Feb 15 2011
I have an applet, which is called by the file
file:///home/lyle/Desktop/linkit/hello.html

I am trying to access the URL of this file in my applet. So I tried the line
String completeURL = getDocumentBase().toString();

However, it is not returning the correct value - it returns the path, but not the filename (ie, not the whole URL)

To debug it, I added this line:
answers.append("url = " + completeURL + "\n");

Which returned the value
url = file:/home/lyle/Desktop/linkit/

Can anyone tell me why this is not returning the entire line?
Thanks!

Edited by: lkb3 on Feb 14, 2011 9:40 PM - fixed a typo

Comments

Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Mar 15 2011
Added on Feb 15 2011
3 comments
129 views