This search
Java tic tac toe 2 clients[
^] should give you enough leads to get started.
Once you have code and run into problems you can always come back here with a more specific question and the community will do its best to help you. Don't forget to post only the relevant code bits that pose the problem as a code dump is not usually helpful at all in getting someone to help/assist you.
Good luck and happy coding.