Hi, again -
1. I think your original question is answered:
a) Yes, "System.in" is the correct way to read with "standard input" from a Java program and
b) Yes, you seem to be doing it correctly.
2. Not certain what exactly you were trying to do, I took a couple guesses that I thought might help:
a) Q: Are you clear about the distinction between command-line arguments (which are read from "args[]") and standard input (which you read from "System.in")?
A: The answer appears to be "Yes" - you're definitely trying to read from standard input.
b) Q: would you be inclined to using a GUI instead of stdin/stdout?
A: The answer also appears to be "Yes"; you're definitely using a GUI, but I'm not clear if it's Swing ... or Something Else...
3. I've still got many questions (what platform are you on? Are we dealing with one program, or multiple concurrent programs? If so, are both written in Java? Does one invoke the other, or are they both started independently? Etc etc etc). But I really don't think it would be helpful for us to go there.
I've got three suggestions (which may or may not be of help):
a) You might want to modify my (working)
test program to try to reproduce the problem. This, in turn, might give you the solution.
b) You might want to consider another way to communicate between your two programs (assuming there *are* two programs). For example: a disk file, a TCP/IP socket or perhaps even JMS.
c) Bear in mind that "communications" involves both:
- The *transport* (standard I/O, file I/O, socket I/O, etc)
- Some form of *synchronization* (is the listener actually ready to
receive before the sender transmits?
Again, I hope that helps!
And please: let us know how you ultimately resolve the problem!