Hi guys, I've got a problem with running applets in my browser. Now, this applet of mine is a part of a "non package" application. It is not a swing applet but one of the windows in the application extends JFrame. Now here's the problem. When I run my applet from the appletviewer, it runs fine. But it does not run when I add it into the browser. It gives me "class not found" whereas the class is in the same directory as the html page. This message just flashes in the status bar. Whats surprising is that, I can easily view the applets over the net and my browser has absolutely no problem with 'em. Plz. help soon...
Error loading class: MainApplet java.lang.NoClassDefFoundError java.lang.ClassNotFoundException: MainApplet at com/ms/vm/loader/URLClassLoader.loadClass at com/ms/vm/loader/URLClassLoader.loadClass at com/ms/applet/AppletPanel.securedClassLoad at com/ms/applet/AppletPanel.processSentEvent at com/ms/applet/AppletPanel.processSentEvent at com/ms/applet/AppletPanel.run at java/lang/Thread.run
the html code is: <html> <title> Main Applet </title> <body> <applet code = MainApplet.class width = 300 height = 200> </applet> </body> </html>
I even tried running the applet using archive but that did'nt work either. I'm able to run applets online. But surprisingly, i'm not able to run the demo applets provided by java with its jdk either.
Hello Agarwal, By default browser uses its own JVM, probably many of them use version 1.1 . So, you must use plugins in browser to enable displaying swing components and a tool such as HTML Converter to change your HTML code (so that it can inform the browser about plugin). But you must make sure that at the client end JDK1.3 must be installed and plugins make the browser to use the installed JDK1.3 to display swing components. Best of luck.