writing to gui
Hi, I have a class a server class and a serverGUI class. Now the server class creates sockets etc and I need to display messages in the serverGUI (in a texfield), as soon as the socket is created. However, since I cant access the texfield from the server class I can't do this.
Any help pls?
You should have the GUI being ran and using the server class, not vice versa. Think a bit that way.
Perhaps the ServerGui object can load a ChangeListener into the Server class, whereby the Server object can notify the gui when changes are made. Then when the gui has been notified, it can call a public method in the server object that gets the text in the string: the observer pattern.