The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
March 2001

Advertisement

Advertisement

This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.

Message:

JApplet and java.lang.instantiationException

Posted by Peter Proud-Madruga on March 28, 2001 at 2:09 PM

I have searched high and low for the answer to this question. I have been on many other web sites where people are searching for the answer to this same question, but no one replies with an answer. I am quite frustrated, and yet I believe the answer is probably a simple one.

I have designed a very simple JApplet. It is a single button. It works fine in Appletviewer, but on IE 5.0 or Netscape 4.6, I get the following error message on the Java Console:


java.lang.InstantiationException: WBC16Applet
at com/ms/applet/BrowserAppletFrame.newInstance
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.processSentEvent
at com/ms/applet/AppletPanel.run
at java/lang/Thread.run

Here is the very simple code:

import javax.swing.*;


public class WBC16Applet extends JApplet
{
private JButton button = new JButton("Testing");
public WBC16Applet()
{
super();
}

public void init()
{
getContentPane().add(button);
}
}

As you can see, I have a constructor. My CLASSPATH reads:
.;c:\progra~1\javasoft\jre\1.3.0_02\lib\rt.jar

I want to mention that supposedly, you don't need a classpath defined in the environment variables for java 1.2

My path statement includes the following:

c:\jdk1.3.0_02\bin;c:\progra~1\javasoft\jre\1.3.0_02\bin

Any help would be WONDERFUL.

Thanks in advance,

Peter Proud-Madruga




Replies:

Sponsored Links



Google
  Web Artima.com   
Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us