ITEC 2610 Lecture 3: Celsius to Fahrenheit
Document Summary
Write a simple java application which will display a frame exactly like the temperature. Note that the text field and the label are centered. Users enter an integer value in the text field, and then press on one of the two buttons to get the conversion. The result should be displayed in the label below the buttons. Both the source and converted temperature are displayed as integers. Hints: the formula to compute fahrenheit from celsius is: f = (9/5)c + 32, the container reference is obtained with. Container c = this. getcontentpane(): integer. parseint(string) is a static method which converts a string into an int, you do not have to write the method main(), which is: public static void main(string[] args) { Tempconvframe appframe = new tempconvframe(); appframe. setdefaultcloseoperation(jframe. exit_on_close); appframe. setsize(250, 100); appframe. show(); Correct answer import java. awt. import java. awt. event. import javax. swing. public class tempconvframe extends jframe implements actionlistener { Jlabel l1; public tempconvframe() { super ("temperature converter ") ;