Can't Run my Applet! Please help!
Hi all, great little forum we got here. I have a question. I am trying to deploy an applet onto web browser. My html code is as follows:
HTML Code:
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head>
<title>TrueNet™ TEST APPLET</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
<link rel="shortcut icon" href="/favicon.ico">
</head>
<body style="border-width:0px;margin:0px;padding:0px;" onResize="ResizeApplet();ResizeApplet();">
<applet id="myApplet" style="border-width:0px;margin:0px;padding:0px;" archive="truenet_fx_test060911REV.jar
" code="TrueNetFX.java" <PARAM width="500" height="500" align="left" vspace="0" hspace="0"><p>Applet Cannot Be Displayed</p>
</applet>
</body>
<script language="JavaScript">
var iMinAppletX = 1000;
var iMinAppletY = 1000;
function ResizeApplet()
{
//ResizeWindow();
if(navigator.appName.indexOf("Opera") != -1)
{
x = document.body.clientWidth;
y = document.body.clientHeight;
}
else
{
x = document.documentElement.clientWidth;
y = document.documentElement.clientHeight;
}
if(x>=iMinAppletX)
{
document.getElementById("myApplet").width = x;
}
else
{
document.getElementById("myApplet").width = iMinAppletX;
}
if(y>=iMinAppletY)
{
document.getElementById("myApplet").height = y;
}
else
{
document.getElementById("myApplet").height = iMinAppletY;
}
}
ResizeApplet();
</script>
What happens is that my .jar file executes perfectly, but when run in a web browser I get ExceptionInInitializerError. Anybody have any suggestions?
Re: Can't Run my Applet! Please help!
Hello JJoelTheMan. Welcome to the Java Programming Forums.
Thank you for the complement!
Is the full error:
java.lang.ExceptionInInitializerError: java.security.AccessControlException: access
denied ??
Re: Can't Run my Applet! Please help!
Quote:
code="TrueNetFX.java
This looks strange. Is your class name: java and is it in the package: TrueNetFX
With this coding, the browser would be looking for the java.class file in the TrueNetFX folder.
When you get errors, please copy and paste the FULL text of the message.