Building a Multi-Client Chat App with Java Sockets, Virtual Threads and JavaFX
For my Advanced Distributed Programming course, I built a group chat application: one server, many clients, real-time messages over TCP, and a JavaFX interface on both sides.
What I built
TCPServer : accepts many clients at the same time, adds the sender's name and time to every message ( [alice 14:05] hello ) and sends it to everyone. Its window shows an activity log and a live list of connected users, each with a random colour.
TCPClient : asks for a username, then opens the chat. Users send with a SEND button or Enter, type allUsers to see who is online, and leave with bye , end or a LEAVE button. An "Online" label with a green circle shows the connection status. Joining without a username gives read-only mode : you can read but not send.
Development process
1. Planning from the requirements. I turned the requirements document into a checklist and a short plan, then chose the architecture before writing code.
2.…