Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

why .class cannot be loaded?

 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have an applet in the html page and browser cannot load class.
did anybody have this problem ?
it's weird but the .class does exist and is in
the same directory as the html file.
any ideas ?
 
mick barry
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look in the Java console and see why it's not loading.
It may be finding it ok, but it's throwing an unahndled exception.
 
chitra ratnawat
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I too had same problem.check your HTML code properly.May be you are missing something.
Inside Applet tag give your class file name in code parameter and comment the whole html code if you are writing in Source Code.
I hope it may solve your problem
chitra
[This message has been edited by chitra ratnawat (edited May 25, 2001).]
[This message has been edited by chitra ratnawat (edited May 25, 2001).]
 
Joel Cochran
Ranch Hand
Posts: 301
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a similar problem with one of my clients. We have an applet that works fine everywhere we test it EXCEPT at this particular client in which they get the same message you are reporting. We haven't confirmed it yet, but I think they need to upgrade their Microsoft Virtual Machine. Just a thought for you to look into...
------------------
I'm a soldier in the NetScape Wars...
Joel
 
Cindy Glass
"The Hood"
Sheriff
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also there are often problem with things that work fine in IE not loading in Netscape and visa versa. Checking the console is step one.
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, the NT console says
# Applet exception: error: java.lang.NoClassDefFoundError: javax/swing/JApplet
java.lang.NoClassDefFoundError: javax/swing/JApplet
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$LoadAppletEvent.dispatch(Compiled Code)
at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled Code)
at java.awt.EventDispatchThread.run(Compiled Code)
at netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled Code)
although it's running if i use appletviewer
 
Angela Lamb
Ranch Hand
Posts: 156
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Swing classes, including JApplet, won't work in most browsers. You'll need the plug-in from Sun:

http://java.sun.com/products/plugin/index.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic