IE says that my applet can't be instantiated

Okay, the applet I've made can be viewed by the appletviewer whereas IE says it can't be instantiated. Is there a problem with regards to inheritance? I've tried using javac -target 1.1 to compile the code and it still didn't work. It does work for my other applets.
I'm posting the codes for the html and the two files I've made.
listapplet.html<html>
<head>
<title>List Applet</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000" background="bbg.jpg">
<applet code="ListApplet.class" width="994" height="67">
</applet>
</body>
</html>
ListApplet.java
import java.awt.*;
import java.awt.event.*;
import java.applet.Applet;
public class ListApplet extends Applet implements ItemListener{
MyList lstsample=new MyList();
Label lblsample=new Label();
public void init(){
setLayout(new GridLayout(2,1));
lstsample.addItemListener(this);
add(lstsample);
add(lblsample);
public void itemStateChanged(ItemEvent ie){
if(ie.getSource()==lstsample){
lblsample.setText("You have chosen"+ lstsample.getSelectedItem());
MyList.java
import java.awt.*;
public class MyList extends List{
     String[] str={"Migs", "Myles", "Jet", "Lans", "Tins", "Liz"};
     MyList(){
          for(int i=0;i<str.length;i++){
               this.add(str);

Errmmm... errors?
How could it have errors when it runs perfectly well with appletviewer? I used the modification you suggested and it did run using appletviewer.
Better yet, it can be compiled by java. I don't think there are errors, really since that kind of error you stated I feel should be found by the Java compiler, that's where I usually encounter such errors.
I'm not really sure if it's how I compiled it(Since somebody told me to compile it using javac -target 1.1 ArchiveName.java and it worked on my other projects that don't have inheritance and uses other classes) I really don't have an idea if it was compiled using 1.1 JVM since I only mostly know the principles of Java and not exactly the more advanced parts.
Besides MyList.java:9 reads like this               
this.add(str);
the value i indicates an integer.
So it's not a String array rather a String object. Maybe something wrong with my post?

Similar Messages

Maybe you are looking for