Chat application in java