Chat system in Java