Block input while JDialog is open
I'm trying to make an RPG game in java and I wanted to show a PNG image. The problem is all game is on the console (it is a text-base game) except the image that I open with JDialog, when I open the image, the consoles freezes (what I wanted to do), but if I write on the console while frozen, the scanner will catch what I typed and when I close the Image will run what I typed. I tried to reset the scanner but it didn't work. Here's an exemple: What I wanted to do: (Show image) User type: hello (User closes image) Type something: User type: bye You typed bye, right? What happens: (Show image) User type: hello (User closes image) Type something: hello You typed hello, right? Here's what I'm doing: https://code.sololearn.com/c1OU22Xs7mrZ