Create a GUI that pops up ONLY if the car is selected. This new window should contain JLabels with JTextFields that allow the user to enter in all the car's relevant information - e.g. Make, Model, Year, Number of Doors, Fuel Tank Capacity, Driving Range, and Extra Load. Use the same inputs from Main.java in the Appendix. The new window should also include two calculate MPG buttons – one for MPG without the extra load and one for MPG with the extra load. When pressed, the buttons use the car constructor to compute the MPG and output the miles per gallon for each scenario. In this case, the MPG without the extra load is 26.0 and the MPG with the extra load is 25.48. Note: assume that the extra load is 100
Create a GUI that pops up ONLY if the car is selected. This new window should contain JLabels with JTextFields that allow the user to enter in all the car's relevant information - e.g. Make, Model, Year, Number of Doors, Fuel Tank Capacity, Driving Range, and Extra Load. Use the same inputs from Main.java in the Appendix. The new window should also include two calculate MPG buttons – one for MPG without the extra load and one for MPG with the extra load. When pressed, the buttons use the car constructor to compute the MPG and output the miles per gallon for each scenario. In this case, the MPG without the extra load is 26.0 and the MPG with the extra load is 25.48. Note: assume that the extra load is 100
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 2 images