A common way to do this is via sockets. Sun has a good tutorial
HERE that should get you started. A bit of advice:
Don't try to write a couple hundred lines of code and make them run. Tackle this in very small chunks.
*Connect first.
*Send a
string from one machine to the other.
*Open a file and read it
*Open a file and write it
*Send a line at a time
*etc ...
If you keep these little pieces nicely separated from each other, you can easily post running code (or not quite running code) here for more tips. Hope that helps!