CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    18

    Why the browser cannot run the applet when the appletviewer can ?

    Why the browser cannot run the applet when the appletviewer can ?

    i have an simple Class file in the directory c:\cdir\named.class
    and am having a HTML file in c:\named.html with code="cdir.named"
    when i run the file as appletviewer named.html it shows the applet but when
    i open the same html file from other browser it shows me the following error.

    Applet cdir.named can't start error:java.lang.ClassFormatError

    The Console reads as follows

    Netscape Communications Corporation -- Java 1.1.2
    Type '?' for options.
    Symantec Java! ByteCode Compiler Version 210.065
    Copyright (C) 1996-97 Symantec Corporation
    # Applet exception: class c.named not found
    java.lang.ClassNotFoundException: java/awt/event/ActionListener
    at java.lang.ClassLoader.defineClass(Compiled Code)
    at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
    at netscape.applet.AppletClassLoader.findClass(Compiled Code)
    at netscape.applet.AppletClassLoader.loadClass1(Compiled Code)
    * at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
    at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
    at netscape.applet.DerivedAppletFrame.run(Compiled Code)
    at java.lang.Thread.run(Compiled Code)



  2. #2
    Join Date
    Sep 1999
    Posts
    18

    Re: Why the browser cannot run the applet when the appletviewer can ?

    in the <applet>-tag of the HTML-code it should say :
    CODEBASE="c:/cdir/" CODE="named.class"

    if the HTML- and class-files are in the same library, you can use :
    CODEBASE="." CODE="named.class"

    Jesper


Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured