Fahrenheit to Celsius Temperature Converter GUI Assignment
Write a GUI to convert Fahrenheit temperatures to Celsius temperatures and has the following appearance:
Initial Image
It must include the following features:
The frame title must say 'Fahrenheit to Celsius Temperature Converter'.
A border layout will be used for the GUI.
The JLabel title of the GUI will say 'Fahrenheit to Celsius Temperature Converter' and be in red and will be placed in BorderLayout.NORTH.
A JLabel of 'Fahrenheit temperature: ' will be placed in BorderLayout.WEST.
A JTextField will be placed in BorderLayout.CENTER and be initialized to spaces and have a width of 8.
A JLabel of ' Celsius Temperature' will be placed in BorderLayout.EAST.
A JButton will be placed in BorderLayout.SOUTH and will contain 'Convert'.
To execute the GUI, place a temperature in the JTextField and click the Convert button. The Convert button handler will then execute and calculate the Celsius temperature and display it as shown in the following image:
Final Image
The Celsius temperature will be calculated using the following formula:
C = 5.0 / 9.0 * (F - 32.0)
and displayed to one decimal place. You can use the Double.parseDouble(textField.getText() ) to get the string value from the JTextField and parse it to a double. Use temperatures that you know the answer to to test your GUI. (i.e. 212.0 and 32.0 and the value above)
Set the size of your GUI to (350, 110). This should give it the appearance as shown above. Your class that represents the GUI should extend JFrame.