Program Not Compiling

Here is my code, the errors are listed at the bottom. Please help, I've been trying to figure this out for 2 hours! This was done using JCreator as my IDE. Instructions on how to fix this would help too. Thanks for your time!

import java.awt.*;

import java.awt.event.*;

import javax.swing.*;

import java.text.DecimalFormat;

public class TempConversion

{

//Necessary GUI components

JLabel celsL;

JLabel fahrL;

JTextField celsTF;

JTextField fahrTF;

//Handlers, used to listen for actions and act accordingly

CelsHandler celsH;

FahrHandler fahrH;

public TempConversion()

{

//Content pane to place all components

Container c = getContentPane();

c.setLayout(new GridLayout(1,4));

//Setting the JLabels

celsL = new JLabel("Celsius: ",SwingConstants.RIGHT);

fahrL = new JLabel("Fahrenheit: ",SwingConstants.RIGHT);

//Setting the JTextFields

celsTF = new JTextField(10);

fahrTF = new JTextField(10);

//Activating celsH and fahrH as objects of CelsHandler and FahrHandler,

//respectively

celsH = new CelsHandler();

fahrH = new FahrHandler();

//Adding the action listeners to the TextFields

celsTF.addActionListener(celsH);

fahrTF.addActionListener(fahrH);

//Adding the components to the content pane

c.add(celsL);

c.add(celsTF);

c.add(fahrL);

c.add(fahrTF);

//Window settings

setTitle("Temperature Conversion");

setVisible(true);

setSize(500,100);

setDefaultCloseOperation(EXIT_ON_CLOSE);

}

//The CelsHandler class

private class CelsHandler implements ActionListener

{

public void actionPerformed(ActionEvent e)

{

DecimalFormat digit = new DecimalFormat("0.00");

double cels, fahr;

//Extracting information from the celsius textfield

cels = Double.parseDouble(celsTF.getText());

fahr = (cels * (9 / 5)) + 32;

fahrTF.setText("" + fahr);

}

}

//The FahrHandler class

private class FahrHandler implements ActionListener

{

public void actionPerformed(ActionEvent e)

{

DecimalFormat digit = new DecimalFormat("0.00");

double cels, fahr;

//Extracting information from the celsius textfield

fahr = Double.parseDouble(fahrTF.getText());

cels = ((fahr - 32) * (5 / 9));

celsTF.setText("" + cels);

}

}

public static void main(String[] args)

{

TempConversion tempConv = new TempConversion();

}

}

The Errors:

C:\Documents and Settings\Jeffrey Chia\Java Programs\TempConversion\src\TempConversion.java:28: cannot find symbol

symbol : method getContentPane()

location: class TempConversion

Container c = getContentPane();

^

C:\Documents and Settings\Jeffrey Chia\Java Programs\TempConversion\src\TempConversion.java:54: cannot find symbol

symbol : method setTitle(java.lang.String)

location: class TempConversion

setTitle("Temperature Conversion");

^

C:\Documents and Settings\Jeffrey Chia\Java Programs\TempConversion\src\TempConversion.java:55: cannot find symbol

symbol : method setVisible(boolean)

location: class TempConversion

setVisible(true);

^

C:\Documents and Settings\Jeffrey Chia\Java Programs\TempConversion\src\TempConversion.java:56: cannot find symbol

symbol : method setSize(int,int)

location: class TempConversion

setSize(500,100);

^

C:\Documents and Settings\Jeffrey Chia\Java Programs\TempConversion\src\TempConversion.java:57: cannot find symbol

symbol : variable EXIT_ON_CLOSE

location: class TempConversion

setDefaultCloseOperation(EXIT_ON_CLOSE);

[3867 byte] By [SilverMoga] at [2007-10-3 3:35:42]
# 1

Just a had brief look, but shouldn't it be:public class TempConversion extends JFrame

If you post code it is a good idea to use the formatting tags:

http://forum.java.sun.com/help.jspa?sec=formatting

Basically the idea is you put [code] at the start of your code and [/code]

at the end.

pbrockway2a at 2007-7-14 21:30:28 > top of Java-index,Java Essentials,New To Java...
# 2
Within TempConversion you're invoking a lot of methods that would exist if the class were a Swing GUI component. But it's not, so the methods don't exist in it. You probably meant TempConversion to extend a Swing component.Were you? If so, add that to the class declaration.
paulcwa at 2007-7-14 21:30:28 > top of Java-index,Java Essentials,New To Java...
# 3
Ah, thank you! That fixed it. Sorry, fairly new to Swing.
SilverMoga at 2007-7-14 21:30:29 > top of Java-index,Java Essentials,New To Java...