Hi,
I have a poker framework for which I am trying to develop a "player" for. Basically I am implementing an object that implements a Player interface defined by the framework. I am trying to put a GUI on top of this player, the way that game play works is that the Dealer invokes the act()
method on my player and expects a return type of Action
. The problem I have is that once the act()
method is invokes, I update the GUI (written using Swing) to display the options available, however I now need the method NOT to return until the player has chosen an option. The options are displayed as JButtons, which when clicked are handled by an actionListener object. How can I make the act()
method not return until the user has acted? I need the thread to sleep/wait until it is woken up by the event being triggered, am unsure of the syntax and best way to do this. Any ideas?
Thanks,
Aly