I am currently writing a Monopoly Game for a project and I have some problems separating the GUI from the main game code.
I use a network connection thread and a main game thread for the game code. Now, when I want to update the GUI, how can I do that ?
a) Have a Thread running in the GUI looking for changes in the main game data and having it update itself ?
b) Use SwingUtility.invokeLater() in the main game Thread. The problem is here, that I have an anonymous Runnable object and I can’t get external variable values into this object ?
c) Use another method … I don’t know yet ?!
So, what is the secret to that ?