Hello, I am working on an IRC client have come to the following stumbling block.
This is as much a project in learning how to program in java as it is to accomplish the task of writing an IRC client.
I have 3 classes as follows:
A - Handles connection with IRC server, sends and receives messages from server
B - GUI, displays IRC messages and contains textbox for user input
C - Main class, instantiates classes A and B.
What I want to do is send a string from object A to object B, using using object C as an intermediary. Currently I have this implemented by using a loop to constantly check if the status of the incomming message string in class A (the IRC server communicator) has changes. This results in 100% CPU usage and is probably not the right way to go about this.
My current thinking is that i need to pass a reference of object B into object A as a parameter ?