Hi,
I think its not related to swing or any thing else. See when u are receiving by using "BufferInputStream" actually all the data gets buffered until it is full only then it is read out of the buffer. So you just need to add
"out.flush();" on ther server code as below.
os.write(buf, 0, cc);
tot += cc;
out.println(tot);
out.flush(); //this u need to this.
if (str.equals(str1)) break;
Hope this works, if you want any thing about this u can mail to my id below.
Mallick
mallick@orillion.stph.net