Question: Write Java program to design a simple temperature and length converter application. NOTE: Please do not use Java Form and do not drag and drop

Write Java program to design a simple temperature and length converter application.

NOTE: Please do not use Java Form and do not drag and drop components

(Need two java classes ConvertFrame.java & ConvertTest.java)

The requirements are: a. Create a Flow Layout.

b. Display a text (Converter) on the title bar.

c. Add two labels as shown in the figure below.

d. Add two text fields with a size of 5 as shown in the figure below.

e. Add two command buttons as shown in the figure below.

Write Java program to design a simple temperature and length converter application.

f. A user can press enter in a text field or click on a button to convert temperature from Fahrenheit to Celsius or length from Inch to Centimeter. i. If a user presses enter in a text field, convert the input and display it. ii. If a user prefers to click on convert button, convert the input and display it.

g. Display the conversion results as integers.

h. Set the width of the frame as 550 and height as 180.

i. Hint: You can use getText() method to get the input from a text field, and you can use setText() method to display the output in a label.

Sample output:

NOTE: Please do not use Java Form and do not drag and

NOTE: Please do not use Java Form and do not drag and drop components

Converter Enter Fahrenheit temperature:[ Convert Fahrenheit to Celsius is: Enter Inch length: Convert Inch to CentiMeter is: Converter Enter Fahrenheit temperature: 45 Convert Temperature in Celsius is: Enter Inch length: 5 Convert Length in Centimeter is: 12

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!