The “real world” is the only world.
Graphical user interfaces, or GUIs, are not just for cute little demonstrations. GUIs are meant to be interfaces for real application programs. This section provides one small example of a
JavaFX GUI that manipulates files.
The program in Listing 10.14 uses
JavaFX to create a GUI that lets you do some housekeeping with your text files. The GUI has three buttons and two text fields. You can type a file name in the indicated text field. If you then click the
Show first line button, the first line of the file is displayed in the other text field as a reminder of what is in the file. However, if the file does not exist or ...