Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GetDocumentBase always returning null

 
Ricardo Prado
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone,

I'm using the method "getDocumentBase()" to get the url where my applet is deployed, but this method ALWAYS returns null!

I've already tried using it inside the init or start method. It always returns null, I have no idea why.


If I use it inside the start method, the Applet draws itself and then it broke(nullpointer exception because I tried to use the URL returned by getDocumentBase)

What can I do?
 
binu narayanan
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

You use the following code

URL base = getDocumentBase();

in your init() method. It shoul return the applet document value.

If still with issue kindly post your code

Binu
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic