File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Applets and the fly likes applet works in appletviewer but not in browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "applet works in appletviewer but not in browser" Watch "applet works in appletviewer but not in browser" New topic

applet works in appletviewer but not in browser

Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9059
I wrote a very simple applet. It works fine in appletviewer. It doesn't work at all in IE or Netscape.

<!-- AboutApplet.html -->
� <head> // deleted for brevity
� </head>
� <body>
��� <applet code=AboutApplet.class width=200 height=100 >
��� </applet>
� </body>

import javax.swing.* ;

public class AboutApplet extends JApplet

��� public void init()
��� {
������� JOptionPane.showMessageDialog( null, "About theApp" );
��� }


IE 5.00 error
java.lang.ClassNotFoundException: javax.swing.JApplet
� at com/ms/vm/loader/URLClassLoader.loadClass
� at java/lang/ClassLoader.loadClassInternal

Doesn't IE 5.00 support Swing?

IE 4.71 error
> \C:\Java\javax\swing\JApplet.class
>java.lang.ClassNotFoundException: javax.swing.JApplet
>at com/ms/vm/loader/URLClassLoader.loadClass

<snipped> etc.

Why is it looking for JApplet in \C:\Java\javax\swing\�when the current directory is C:\java� ???

NN4.72 error
>Netscape Communications Corporation -- Java 1.1.5

Hmmm. Maybe this error is because NN is using Java 1.1.5
But I do have Java Plug-in 1.3 for Netscape Navigator with JDK/JRE 1.3 installed and enabled.

>Symantec Java! ByteCode Compiler Version 210.065
>Copyright (C) 1996-97 Symantec Corporation
># Applet exception: error: java.lang.ClassFormatError: Class already loaded
>java.lang.ClassFormatError: Class already loaded
> at java.lang.ClassLoader.defineClass(Compiled Code)
> at netscape.applet.AppletClassLoader.loadClass(Compiled Code)
> at netscape.applet.AppletClassLoader.findClass(Compiled Code)

[This message has been edited by Marilyn deQueiroz (edited June 03, 2001).]

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
java puneri

Joined: Jun 04, 2001
Posts: 14
you have to modify your applet.HTML file to download the swing plugin from site automatically.
I know one tool 'HTMLConverter' which converts your html file to require syntax. This tool is available on internet, Search in google search engine.
puneguy !
I agree. Here's the link:
subject: applet works in appletviewer but not in browser
It's not a secret anymore!