TempConvertApplet

TempConvertApplet - /Java program to convert the...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
//Java program to convert the temperature between //Celsius and Fahrenheit. / import java.awt.*; import java.awt.event.*; import javax.swing.*; i //public class TempConversion extends JFrame // //Replace JFrame with JApplet // public class TempConvertApplet extends JApplet { private JLabel celsiusLabel; private JLabel fahrenheitLabel; private JTextField celsiusTF; private JTextField fahrenheitTF; private CelsHandler celsiusHandler; private FahrHandler fahrenheitHandler; private static final int WIDTH = 500; private static final int HEIGHT = 50; private static final double FTOC = 5.0 / 9.0; private static final double CTOF = 1.8; // 9 / 5 private static final int OFFSET = 32; //public TempConversion() // //Replace this constructor with the init method // public void init() { //setTitle("Temperature Conversion"); // //Delete setTitle // Container c = getContentPane(); c.setLayout(new GridLayout(1, 4)); celsiusLabel = new JLabel("Enter Celsius", SwingConstants.RIGHT); fahrenheitLabel = new JLabel("Enter Fahrenheit ",
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/17/2011 for the course COMP 2301 taught by Professor Staff during the Spring '10 term at Kennesaw.

Page1 / 2

TempConvertApplet - /Java program to convert the...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online