You need a chat server program which can persist conversations (like have a DB or pesistent store at the server side). Chat client(s) can connect to chat server and communicate with each other.
Google for chat server programs in java, you can find many.
Post by:autobot
when your children are suffering from your punishment, tell your them it will help them write good poetry when they are older. Like this tiny ad:
a bit of art, as a gift, the permaculture playing cards