Applet not displayed in Browsers

Hello!

I am using JDK1.2.2 and developing applets that are using the Swing components that were introduced in JDK 1.2. When I run the applet in applet viewer it runs fine but when I try to run it in the Browsers (Netscape 4.7 or IE 5.0/5.5) the applet is not displayed. Netscape shows this exception in the Java Console :

Netscape Communications Corporation -- Java 1.1.5Type '?' for options.Symantec Java! ByteCode Compiler Version 210.065

Copyright (C) 1996-97 Symantec Corporation

warning: running 1.2 version of SwingUtilities# Applet exception: error: java.lang.NoClassDefFoundError: sun/awt/AppContextjava.lang.NoClassDefFoundError: sun/awt/AppContext at javax.swing.SwingUtilities.appContextGet(Compiled Code) at javax.swing.TimerQueue.sharedInstance(Compiled Code)* at javax.swing.JApplet.<init>(Compiled Code) at TreeApplet.<init>(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)

Apparently the problem seems to be the version of JRE/JVM that the Browser seems to be using (which in this case is Java 1.1.5 which incidentally does not support swings) a previous version of the JVM.

I would be obliged if somebody can help me with this.

Adnan

[1477 byte] By [adnan 027] at [2007-9-26 4:12:00]
# 1

Sorry to tell you but that is exactly it. The default jvm that is used by the browsers, does not support swing.

If you are in control of the applets intended environment, such as an intranet only setting, then you can opt to use swing by applying sun's jvm plug-in for browsers. This will force the browser to use a java1.2 or better complient jvm instead of the default one supplied by Netscape or Microsoft.

see: http://java.sun.com/products/plugin/index.html for more info on the plug-in.

Otherwise I'd suggest you start pulling all your javax.swing stuff out and use only awt.

klhanich at 2007-6-29 13:17:30 > top of Java-index,Archived Forums,New To Java Technology Archive...
# 2

Try running the htmlconverter from the command line.

Example: C:\jdkblah\bin htmlconverter Myhtml.html.

This should work. As far as I know, swing applets need to be converted to run from an html file inside a browser. If you don't have the converter you can download it.

Jamie

gandalf33 at 2007-6-29 13:17:30 > top of Java-index,Archived Forums,New To Java Technology Archive...