I'm trying to create a simple GUI with swing I get compilation error..
"Tempconverter is not absract and does not override absract method actionPerformed (java.awt.event.ActionEvent) in (java.awt.event.ActionListener).
This is my code
import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import java.util.*;
public class Tempconverter extends JFrame implements ActionListener{
//actionlistener is in event sub package
JTextField celcius;
JButton convert;
JTextField farenhite;
Tempconverter(){
celcius =new JTextField (15);
farenhite=new JTextField (15);
convert=new JButton("convert");
//Insert Layout manager to arrange the componetes
setLayout(new FlowLayout());
//if the 'convert' button is pushed the button informs the same object
//this is the reference to the same object
convert.ActionListener(this);
//adding components to the pane
getContentPane().add(celcius);
getContentPane().add(convert);
getContentPane().add(farenhite);
}
public void actionPerfomed(ActionEvent ev){
int value=Integer.parseInt(celcius.getText());
int far=(value*9/5)+32;
farenhite.setText(Integer.toString(far));
}
public static void main( String args[]){
Tempconverter tc=new Tempconverter();
tc.setSize(500,500);
tc.setVisible(true);
}
}
Thankx