I am programming a game. During a player's turn, they will need to select an action from a list of actions. For this purpose, I am using a MouseAdapter added to pnlActionButtons (JPanel) that has the action iconography painted on it. I.e. they would click on the picture of the "thing to do" and that gets translated into variable that I switch on inside of the mouseReleased() method.
Where I am running into a roadblock is that, for some game actions, I need to select 2 items to provide context for the action. E.g., I need the game piece clicked on and a destination to move it to. How do I get the mouseReleased() in pnlActionButtons to wait for clicks in Gameboard (extends JPanel) to pass the context to where I need it?