10.7 Graphics Supplement

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.

Programming Example A JavaFX GUI for Manipulating 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 ...

Get Java: An Introduction to Problem Solving and Programming, 8th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.