I am trying to create a Celsius Converter GUI using KeyListener to get information from the user and then processing it afterwards but I can't seem to get it to work and I need help. Below is the code I have so far and I would appreciate it if anyone could help me get this problem fixed.

Java NewBie


import java.awt.*;
import java.awt.event.*;
import javax.swing.*;

public class CelsiusCalculator extends JFrame implements KeyListener
{
JTextField fahTextField;
JLabel celsLabel, fahLabel,displayCelsius;
JButton convert;
//KeyListener Listener;
//---------------------------------------------------------------------------------------------------------
//Constructor
public CelsiusCalculator()
{
super("Fahrenheit To Celsius Calculator");
FlowLayout placer=new FlowLayout(FlowLayout.LEFT);
setLayout(placer);
fahLabel = new JLabel ("Enter FahrenHeight Value: ");//Label for Fahrenheit
add(fahLabel);
//Create a text box of size 10
fahTextField = new JTextField(10);//Textbox to get Fahrenheit input
add(fahTextField);
celsLabel = new JLabel ("Celsius: ");//Label to display the CELSIUS
add(celsLabel);
displayCelsius = new JLabel ("");//Label to Output result in
add(displayCelsius);
convert = new JButton("Convert");
add(convert);
convert.addKeyListener(this);//allow frame to process key events
setVisible(true);
}// End Constructor

//------------------------------------------------------------------------------------------------------------
//implementation of KeyListener methods
public void keyPressed(KeyEvent e)
{
CalcCelsius(e);
}
public void keyReleased(KeyEvent e)
{
CalcCelsius(e);
}
public void keyTyped(KeyEvent e)
{
CalcCelsius(e);
}
//calculation using the information provided by user
public void CalcCelsius (KeyEvent e)
{
int temp = (int)((Double.parseDouble(e.getKeyText(e.getKeyCode()))-32)*0.56);
displayCelsius.setText(temp+" Degrees");
}// CalcCelsius
//-----------------------------------------------------------------------------------------------------------------
// private static void ShowConverter() {
//Make sure we have nice window decorations.
// JFrame.setDefaultLookAndFeelDecorated(true);
// CelsiusCalculator celsium = new CelsiusCalculator(); }
public static void main(String[] args)
{ //listen to events from the fahTextField
JFrame.setDefaultLookAndFeelDecorated(true);
CelsiusCalculator celsium = new CelsiusCalculator();
}

}//End of Class