I'm practicing java language.. please help me out
I got this error saying..
cannot find symbol
symbol: constructor compAdd()
location: class compAdd
compAdd c1 = new compAdd();
///////////////compAdd.java
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class compAdd extends JFrame
{
public JButton button = new JButton("Add");
public JTextField txt1, txt2, txt3;
public compAdd(String title)
{
super(title);
txt1 = new JTextField(5);
txt2 = new JTextField(5);
txt3 = new JTextField(5);
this.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
JPanel cen = new JPanel();
cen.add(txt1);
cen.add(txt2);
cen.add(txt3);
cen.add(button);
Container contentPane = this.getContentPane();
contentPane.add(cen, BorderLayout.CENTER);
addMe am = new addMe(this);
button.addActionListener(am);
}
public static void main(String [] args)
{
JFrame f = new compAdd("Addtion");
f.setSize(400,400);
f.setVisible(true);
}
}
//////////////addMe.java
import javax.swing.*;
import java.awt.event.*;
import java.awt.*;
public class addMe implements ActionListener
{
private Container container;
public addMe(JFrame c)
{
container = c.getContentPane();
}
public void actionPerformed(ActionEvent ae)
{
String label = ae.getActionCommand();
if (label == "Add")
{
int txt1,txt2,txt3;
compAdd c1 = new compAdd();
txt1 = Integer.parseInt(c1.txt1.getText());
txt2 = Integer.parseInt(c1.txt2.getText());
txt3 = txt1 + txt2;
c1.txt3.setText(String.valueOf(txt3));
}
}
}