1. Engineering
  2. Computer Science
  3. java in a previous assignment i made a gui like...

Question: java in a previous assignment i made a gui like...

Question details

JAVA

In a previous assignment I made a GUI like the image below. I now need to Add the indicated additional functionality to my program. If a file name or path for a text file is entered into the textbox (in the lower left corner of the GUI) and the "Get" button is clicked, the contents of the indicated text file will be displayed in the textarea (the large text control that takes up the majority of the GUI). If the "Save" button is clicked, the contents of the textarea will be saved to a text file at the location indicated by the text field. If an IOException is thrown while attempting to get or save a file, display an error message in the textarea. The "Clear" button is clicked, the contents of the textbox and the textarea should be cleared.

Note -- when you save text to a file, or read text back from a file, all linebreaks (a.k.a. newlines) should be respected. So if you enter the following into the editor:

Once upon

a time

Then that should be saved to your text file as two lines of text. Likewise, if you read that text file and display it in your editor window, it should display as two lines of text.

Get Save Clear

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution