Write a JavaFX application that implements a simple text editor. Use a text field and a button to get the file. Read the entire file as characters and display it in a TextArea. The user will then be able to make changes in the text area. Use a Save button to get the contents of the text area and write that over the original file. Technical Details: Read each line from the file and then use the method append( aString) to display the line in the text area. The method getText will return all of the text in the text area in a string that then can be written to the file.

Surprisingly, using just the built-in text area component of Java a simple editor can be created. The text editing is done via the operating system on the text in the component. What is left for us to do is to read and write the file, which is accomplished with a pair of methods.

See the code in SimpleEditor.java.

Computer Science & Information Technology

You might also like to view...

To drag a window to a new location on the desktop you should _____.

A. click anywhere in the window B. click on the bottom of the window C. click the upper-right corner D. click the title bar

Computer Science & Information Technology

Borders can present a problem for liquid layouts because browsers do not recognize ____ values for border widths.

A. pixel B. percentage C. specific D. binary

Computer Science & Information Technology