We programmed a game with two windows: MainMenu and Playfield. When you click on start in the MainMenu - Playfield opens. In the MainMenu there are 2 JTextfields, where the two players can enter their name. At the moment the 2 JTextfields doesn't have any functionality.
Now the question is: We want to get this name and we want to store them till somebody wins and after win is true we want to output something like "xy wins!" in a Dialog Box. How can we implement that in both windows?