Java Swing: Waiting for Mouse Clicked event before returning an Int [duplicate]
问题 This question already has answers here : Swing GUI doesn't wait for user input (2 answers) Closed 3 years ago . I have a card game and which is built on using ArrayLists to store the cards in peoples hands. I have a main method which plays through the game and updates the GUI class using threads called using InvokeLater in the main class At the moment I'm playing the game on the console and inputting and int into a scanner to make the selection of card from the players hand. What I want to do