GetCodeBase() and GetDocumentBase() return null
Hello i have a liite problem.
When i try to use getDocumentBase() or getCodeBase() the stub of the applet is null so i get a nullpointer exception. I've maid a very basic JApplet that just calls getDocumentBase() and prints the result.
I've tried the following applet and html (placed applet and html in the same folder, opening html file with IE or FireFox and i see that the applet is not loaded, the error from the java console is:
java.lang.NullPointerException
at java.applet.Applet.getDocumentBase(Unknown Source)
at MyPackage.NewJApplet.<init>(NewJApplet.java:10)
Here is the code:
jar:
public class NewJApplet extends javax.swing.JApplet
{
/** Creates a new instance of NewJApplet */
public NewJApplet()
{
String temp = getDocumentBase().toString();
System.out.println(temp);
}
}
html:
<html>
<head>
<title></title>
</head>
<body>
<Applet code="MyPackage.NewJApplet.class" archive="JavaApplication12.jar" width="600" height="400">
</body>
</html>

