A main difference between using console I/O with a user and a GUI is that the program doesn't ask a question and wait for the response in the same way.
With GUI the program shows a screen with the question and some input areas and buttons that the user can fill in and press a button. The program shows this screen and then exits to the JVM to wait on the user's input. When the user enters data and presses a button, the JVM calls a listener method in the program where the code can gather the data that was entered, do some processing, build and show a new GUI and then return to the JVM to wait for the user to respond.