Question: Create a class called Question1 , and inside this class implement the following GUI: This GUI works as follows: The user enters a file name
Create a class called Question1, and inside this class implement the following GUI:

This GUI works as follows:
The user enters a file name in the file-name text field,
Clicking the Read from file button does the following:
- Opens the specified file and reads numerical strings from it. Assume that the inputs are separated by newlines. Hint: read the inputs inside a loop statement.
- Parse each of the numerical strings to Integer.
- Stores all the integer numbers inside an array of integers.
Clicking the Compute sum button computes the sum number of all the integer values in the array, and shows the output in the proper text field.
Clicking the Exit button ends the program execution.
Important note: You must implement all the necessary ActionListener classes (inner classes) for the three buttons, and implement the necessary code to register the listener objects.
Read Inputs Enter file name: Read from File Compute sum The sum is: Exit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
