clear line between Swing and code

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 ?

hmmm… you could try looking up the MVC (Model View Controller) pattern. Then have listeners that update info in the view (Swing GUI) when things change int eh model (Game), I guess.

google should have lots of info on it and different way’s of implementing it.

Dan.