i have written a standalone connect 4 game.
next i would like to be able to play it over network and also have a chat function.
connect 4 GUI (JFrame) holds -> connect 4 game model
i would like to implement connect 4 network GUI(JDialog) (here the user can choose to act as a server or client) that holds Network API. (server only serving a single connection)
and finally a Chat GUI (JDialog) to exchange messages.
my question is how do i implement inter class/GUI communication? when a network message is received it ought to be delivered to the right receiver (game / chat) also messages sent from chat / game transmitted to remote machine.
i have looked into inner classes but was told it is a bad idea to implement so much with in single class and i did not like this idea a lot either.
i have written another game battleships in C# and it uses delegates to accomplish this task but sadly im informed that delegates are not available in Java.
im a beginner and at the moment exploring options so im open to your guidance.
thank you.