Results 1 to 8 of 8
  1. #1
    rodneyc8063 is offline Member
    Join Date
    Nov 2011
    Posts
    7
    Rep Power
    0

    Default Problem running Applet in IE but works when running just Java in Netbeans?

    I made an applet and was able to run it via Netbeans by right clicking on the java file and I can see it in the Applet viewer

    I also made an html page with the <APPLET> tag in it, and when i try to run the applet in IE it gives me an error

    "Error click for details"

    I click then i get the following


    Java Plug-in 10.0.0.147
    Using JRE version 1.7.0-b147 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\Rodney Chan
    ----------------------------------------------------
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    ----------------------------------------------------
    Detected from bootclasspath: C:\PROGRA~1\Java\jre7\lib\deploy.jar

    My HTML is as simple as it gets
    ------------------------------------------

    <html>
    <head>
    <title>The Bouncing Balls Applet</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
    <div>This is a simulation using threads of two bouncing balls</div>

    <APPLET code="Pong.class" width=250 height=200></APPLET>
    </body>
    </html>
    -----------------------------------------

    Am i missing something to get this to run inside a web browser?

    Thanks...

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,559
    Rep Power
    25

    Default Re: Problem running Applet in IE but works when running just Java in Netbeans?

    Detected from bootclasspath: C:\PROGRA~1\Java\jre7\lib\deploy.jar
    I haven't seen that message before.
    Have you tried running the applet in the AppletViewer by opening the html file in the AppletViewer program?
    Maybe the error message would give some more info.

    Do you have any other browsers you could try it in?

  3. #3
    rodneyc8063 is offline Member
    Join Date
    Nov 2011
    Posts
    7
    Rep Power
    0

    Default Re: Problem running Applet in IE but works when running just Java in Netbeans?

    Hey Norm

    If i understand you correctly, I have tried running it in the Appletviewer program

    I am using netbeans, so I would go to the actual Java file I created, right click and select "Run".

    I then get a little window that says "Applet Viewer: Pong.Class" and I can see my program working.

    Im not sure how to open the actual appletviewer and select my html file to run it in?

    I been trying to google around and am quite stumped, as the HTML looks fine, and the program seems to run fine stand alone in appletviewer....

  4. #4
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,559
    Rep Power
    25

    Default Re: Problem running Applet in IE but works when running just Java in Netbeans?

    how to open the actual appletviewer and select my html file to run it in
    The AppletViewer program is in the JDK bin folder with the javac command etc. Its a commandline program.
    Open a command prompt window, change to the folder with the HTML file and enter:
    AppletViewer <YOURHTML>.html

  5. #5
    rodneyc8063 is offline Member
    Join Date
    Nov 2011
    Posts
    7
    Rep Power
    0

    Default Re: Problem running Applet in IE but works when running just Java in Netbeans?

    Weird Im trying to post a reply but doesnt seem to be saving...

    Anyways

    I gotcha!

    I was able to run the appletviewer via the command line and saw my program execute no problem, but i still cant get it to run via a web browser?

  6. #6
    patriotsfan is offline Member
    Join Date
    May 2011
    Posts
    38
    Rep Power
    0

    Default Re: Problem running Applet in IE but works when running just Java in Netbeans?

    Did you type the project path correctly? Such as.... "code=project/Pong.class" if your Pong.java was located inside a folder named project.
    Last edited by patriotsfan; 11-28-2011 at 10:56 AM.

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    17,559
    Rep Power
    25

    Default Re: Problem running Applet in IE but works when running just Java in Netbeans?

    I don't know why IE wouldn't put an error message in the java console if it had an error with the applet.

  8. #8
    javahamster is offline Member
    Join Date
    Dec 2011
    Posts
    1
    Rep Power
    0

    Default Re: Problem running Applet in IE but works when running just Java in Netbeans?

    I had exactly the same problem, only I am working with Eclipse. The applet ran fine in Eclipse but not in the browser. Error messages on Java Console are the same:

    Java Plug-in 10.1.0.8
    Using JRE version 1.7.0_01-b08 Java HotSpot(TM) 64-Bit Server VM
    User home directory = C:\Users\javahamster
    ----------------------------------------------------
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to <n>
    ----------------------------------------------------
    Detected from bootclasspath: C:\\PROGRA~1\\Java\\jre7\\lib\\deploy.jar


    In my case this was a newbie problem. Eclipse places the .class-files to WEB-INF-folder. Though WEB-INF and the html launching the applet are in the same WebContent-folder (which doesn't exist in NetBeans), the class files weren't visible to the html file. So I manually copied the class files right next to the html file and that helped.

Similar Threads

  1. Applet Running in Java not from Cmd
    By vin_eets in forum Java Applets
    Replies: 1
    Last Post: 03-29-2011, 04:08 PM
  2. Problem running oustide of NetBeans
    By CollinD in forum Java Applets
    Replies: 5
    Last Post: 12-13-2010, 02:07 PM
  3. Little problem I'm running with my applet
    By Lightcraft in forum Java Applets
    Replies: 1
    Last Post: 04-09-2010, 01:27 AM
  4. Java Applet Not Running
    By kahaj in forum Java Applets
    Replies: 4
    Last Post: 10-08-2009, 12:11 AM
  5. Replies: 0
    Last Post: 08-26-2009, 01:03 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •