Yes, you can use TCP for this and yes, Java sockets can do TCP.

If I were you, I'd start by following this tutorial: http://download.oracle.com/javase/tutorial/networking/sockets/