Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Adding a listener to a chat room

Status
Not open for further replies.

ChrisB02

Programmer
Mar 19, 2002
2
GB
I've written a chat room in java that uses a client and a server. I've implemented multiple clients, which works but when the you write a message, user 2 has to click the submit button to view what i sent.
E.g:
***************************
if ((e.getSource() == submitButton)||(e.getSource() == message))
{
try
{
out.println(message.getText());
response = in.readLine();
output.setText(output.getText() + response + "\n");
message.setText("");

}
}
*************
I understand why this happens, and i think i've got to implement a listener that constantly listens for new inputs on the readLine.in
any ideas of how to do this?????
cheers
chris
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top