Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Can't Run my Applet! Please help!

  1. #1
    Junior Member JJoelTheMan's Avatar
    Join Date
    Jun 2011
    Location
    Placerville, CA
    Posts
    2
    My Mood
    Amazed
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default 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?


  2. #2
    mmm.. coffee JavaPF's Avatar
    Join Date
    May 2008
    Location
    United Kingdom
    Posts
    3,336
    My Mood
    Mellow
    Thanks
    258
    Thanked 287 Times in 225 Posts
    Blog Entries
    4

    Default 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
    ??
    Please use [highlight=Java] code [/highlight] tags when posting your code.
    Forum Tip: Add to peoples reputation by clicking the button on their useful posts.

    Looking for a Java job? Visit - Java Programming Careers

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    SW Missouri
    Posts
    20,348
    Thanks
    49
    Thanked 2,203 Times in 2,176 Posts

    Default Re: Can't Run my Applet! Please help!

    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.

Similar Threads

  1. when i run applet
    By chonch in forum What's Wrong With My Code?
    Replies: 2
    Last Post: February 22nd, 2011, 03:56 PM
  2. [SOLVED] Disappearing applet, where's it going?
    By bradleysm in forum What's Wrong With My Code?
    Replies: 1
    Last Post: January 29th, 2011, 08:41 PM
  3. applet img
    By wolfgar in forum Java Theory & Questions
    Replies: 5
    Last Post: April 7th, 2010, 09:14 PM
  4. [SOLVED] applet vs. gui app
    By rptech in forum AWT / Java Swing
    Replies: 3
    Last Post: August 27th, 2009, 09:13 AM
  5. Problem of implementing mathematic logic in Java applet
    By AnithaBabu1 in forum Java Applets
    Replies: 0
    Last Post: August 15th, 2008, 11:42 PM

Tags for this Thread