9
CREATE JAVA CODING
Event Driven Programming Learning outcomes 1. Leam and understand event-driven programming (C3) 2. Construct object-oriented program using Event-driven GUI. (C3, P4) Question 1 Write a program that allows user to enter a length value in a class called LengthConverter. Then, it will calculate the conversion of length measure either from feet to centimeters or from centimeters to feet unit. Add listeners in the program to handle the events. When user clicks the button "Feet to Centimeters" or "Centimeters to Feet', show the result in 'Result' text field. The formula for Feet and Centimeters are as follows: Feet Length 30.48 Centimeters length 30.4 The interface will be as follows: Enter length: Result: Feet to Centimeters Centimeters to Feet (Hint: Use the JFrame class) Write the main class that invokes the LengthConverter class.
9 CREATE JAVA CODING
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am