The "loop" when you use GUI includes the JVM waiting for the user to input some data.
The code presents data in the GUI and exits to the JVM. The user interacts with the GUI perhaps pressing some...