Im making a chat application where one client will send a message to ALL other clients who are currently online through server.
The problem is that I'm unable to make such a loop which can infinitely send n receive messages using server.
Secondly can't we just use PrintWriter and BufferedReader, why to use DataInputStream :S
Here is the loop i was trying to make:
for( ; ; )
{
str = in.readLine();
if(str == "") break;
jTextArea1.append("\n" + str);
} // this is for Receiving the data frm server
I dont know how to send that, may be like that
out.println(jTextField1);
Im totally stuck in it..hope to get some help
Thanks.