Register / Login
GetDocumentBase always returning null
posted 6 years ago
I'm using the method "getDocumentBase()" to get the url where my
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?
posted 5 years ago
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
where to put image jar files
getDocumentBase() not working???
how to use getDocBase() in Java
Read xml file placed on localhost