import java.awt.*;
import java.awt.event.*;//for specifying windows events
import javax.swing.*;
import java.lang.*;
public class FrontE implements ActionListener,Runnable
{
JTextField jav,it,c;
Frame f;
JButton Submit;
int aa,bb,cc,tot;
float avg;
FrontE()
{
f=new Frame("Progress Calculator");
JLabel l1=new JLabel("Enter the marks here:");
f.add(l1);
Panel p=new Panel();
Panel p1=new Panel();
JLabel java=new JLabel("Java");
jav=new JTextField(3);
System.out.println(" ");
JLabel itc=new JLabel("Information Theorey");
it=new JTextField(3);
JLabel cn=new JLabel("Computer Networks");
c=new JTextField(3);
aa=Integer.parseInt(jav.getText());
bb=Integer.parseInt(it.getText());
cc=Integer.parseInt(c.getText());
p.setLayout(new GridLayout(3,1));
p.add(java);
p.add(itc);
p.add(cn);
p.add(jav);
p.add(it);
p.add(c);
Submit=new JButton("Submit");
p.add(Submit);
p1.add(p);
f.add(p1,BorderLayout.CENTER);
f.setSize(500,300);
f.setVisible(true);
Submit.addActionListener(this);
Thread T=new Thread(this);
T.start();
}
public void run()
{
try{
tot=aa+bb+cc;
avg=tot/3;
}
catch(Exception e)
{
}
}
public void actionPerformed(ActionEvent ae)
{
String str = ae.getActionCommand();
if(str.equals("Submit"))
{
f.setVisible(false);
JFrame f2=new JFrame("Result");
f2.addWindowListener(new WindowAdapter(){
public void windowClosing(WindowEvent e){
System.exit(0);
}});
JLabel Total=new JLabel("TOTAL:");
JLabel t=new JLabel(Float.toString(tot));
JLabel avv=new JLabel("AVERAGE");
JLabel av=new JLabel(Float.toString(avg));
f2.setLayout(new GridLayout(3,1));
f2.add(Total);
f2.add(t);
f2.add(avv);
f2.add(av);
f2.setSize(300,300);
f2.setVisible(true);
}
}
public static void main(String ar[])
{
new FrontE();
}
}
i am trying to implement a simple multithreaded program in java...this prog shows me 5 errors...all are "cannot find symbol" error..pls help me out..i have to submit this assignment tomorrow