plz help me in resolving a error:applet started:applet not initialized

import java.awt.*;
import java.awt.Button;
import java.awt.Label;
import java.awt.TextField;
import java.applet.*;
import java.applet.Applet;
import java.awt.event.*;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
//<applet code="prg9.class" height=600 width=500> </applet>
 
public class prg9 extends Applet implements ActionListener
{
 
 String str=" ";
 TextField tf[ ] = new TextField[3];
 Label name,regno,percentage,per,result,res,totmarks;
 Button reset,report;
 Label lab[ ] = new Label[9];
 public void init( )
 {
   name=new Label("Enter name");
   regno=new Label("Enter regno:");
   totmarks=new Label("Enter total marks");
   percentage=new Label("percentage");
   per=new Label(" ");
   result=new Label("result");
   res=new Label(" ");
   for(int i=0;i<3;i++)
   {
    TextField tf[]=new TextField[20];
   }
   for(int i=0;i<9;i++)
   {
    Label lab[ ]=new Label[9];
   }
   report =new Button("Create Report");
   reset=new Button("Reset");
   setLayout(new GridLayout(10,1));
   add(name);
   add(tf[0]);
   add(lab[0]);
   add(regno);
   add(tf[1]);
   add(lab[0]);
   add(totmarks);
   add(tf[2]);
   add(lab[0]);
   add(percentage);
   add(per);
   add(lab[0]);
   add(result);
   add(res);
   add(lab[0]);
   add(report);
   add(lab[0]);
   add(reset);
   report.addActionListener(this);
   reset.addActionListener(this);
 }
public void actionPerformed(ActionEvent ae)
{
  str=ae.getActionCommand();
  int tot=Integer.parseInt(tf[2].getText());
  int perc=tot/5;
  per.setText(" " + perc);
  if(str.equals("Create Report"))
   {
     if(perc>=50 && perc<60)
      {
        res.setText("Second Class");
      }
      else
        if(perc>=60 && perc<85)
      {
       res.setText("First Class");
      }
      else
         if(perc>=85)
      {
        res.setText("Distinction");
      }
      else
         if(perc>=35 && perc<50)
      {
        res.setText("Pass");
      }
      else
      {
         res.setText("Fail");
      }
     }
     else
     {
       Label msg=new Label("Passes Invalid Data");
     }
     if(str.equals("reset"))
      {
        per.setText(" ");
        res.setText(" ");
        for(int i=0;i<3;i++)
        {
          tf[i].setText(" ");
        }
      }
}
public void paint(Graphics g)
{
  g.drawString(str,200,200);
}
}

some1 plz help me soon..........i have my exams tommorrow

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.