If I had to write one from scratch for an assignment I'd start with Sockets. Sun's All About Sockets is a great starting point.
One hint: The program on your desktop is likely to act as a client and a server at the same time. And the program you'd probably call the server will act as a server and client at the same time. Don't worry if that hurts your brain at first. See how clients and servers work and see if it makes sense.
Feel free to get some ideas into code and post them for comments. Have fun!
A good question is never answered. It is not a bolt to be tightened into place but a seed to be planted and to bear more seed toward the hope of greening the landscape of the idea. John Ciardi
You should think of the logical Network you want to use. If you want a serverbased application perhaps you should use a own implementation using sockets. An alternate way would be the use of Jabber. If you want a real P2P-solution you should try JXTA, the SUN P2P-Framework. Bye Mark