A real-time multiplayer drawing application with integrated voice chat functionality, built with Java Swing. Perfect for LAN parties, office breaks, or collaborative drawing sessions with friends on the same network.
- Features
- System Requirements
- Installation
- Running the Application
- Testing the Application
- Usage Guide
- Troubleshooting
- Technical Details
- Contributing
- License
✨ Core Functionality
- Real-time collaborative drawing canvas
- Synchronized drawing across all connected clients
- Pencil and eraser tools with customizable sizes
- Group text chat for all participants
- One-on-one voice calls between users
- Live user list with online status
- Canvas clear synchronization
- Connection ping monitor
- Full LAN network support
- Operating System: Windows 7/8/10/11, macOS 10.12+, or Linux (Ubuntu 18.04+)
- Java: JDK 11 or higher
- RAM: 512 MB minimum (1 GB recommended)
- Network: LAN/Wi-Fi connection
- Microphone: Required for voice chat functionality
- Speakers/Headphones: Required for receiving voice calls
- Java JDK 17 or later
- 2 GB RAM or more
- Stable network connection with low latency
- Quality microphone and headphones for best voice experience
Before running the application, you need to install Java Development Kit (JDK) on your system.
-
Download Java JDK
- Visit the Oracle JDK Downloads page
- Or download OpenJDK (recommended for free distribution)
- Download the Windows x64 Installer (.exe file)
-
Install JDK
- Run the downloaded installer
- Follow the installation wizard
- Note the installation path (typically
C:\Program Files\Java\jdk-17) - Click "Install" and wait for completion
-
Set Environment Variables
- Right-click "This PC" → Properties → Advanced System Settings
- Click "Environment Variables"
- Under "System Variables", click "New"
- Variable name:
JAVA_HOME - Variable value: Your JDK installation path (e.g.,
C:\Program Files\Java\jdk-17) - Find "Path" variable, click "Edit"
- Add new entry:
%JAVA_HOME%\bin - Click "OK" on all windows
-
Verify Installation
java -version javac -version
Both commands should display version information.
-
Using Homebrew (Recommended)
# Install Homebrew if not already installed /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" # Install Java brew install openjdk@17 # Link Java sudo ln -sfn /opt/homebrew/opt/openjdk@17/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk-17.jdk
-
Manual Installation
-
Set JAVA_HOME (Optional but Recommended)
echo 'export JAVA_HOME=$(/usr/libexec/java_home)' >> ~/.zshrc source ~/.zshrc
-
Verify Installation
java -version javac -version
-
Install OpenJDK
# Update package index sudo apt update # Install OpenJDK 17 sudo apt install openjdk-17-jdk -y
-
Set JAVA_HOME
# Find Java installation path sudo update-alternatives --config java # Add to ~/.bashrc or ~/.zshrc echo 'export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64' >> ~/.bashrc echo 'export PATH=$JAVA_HOME/bin:$PATH' >> ~/.bashrc source ~/.bashrc
-
Verify Installation
java -version javac -version
-
Clone the Repository
git clone https://github.com/madesh405/LAN_Pictionary.git cd LAN_Pictionary -
Or Download ZIP
- Visit the GitHub repository
- Click the green "Code" button
- Select "Download ZIP"
- Extract the ZIP file to your desired location
- Navigate to the extracted folder in terminal/command prompt
Navigate to the project directory and compile the Java files:
# Compile the server
javac Server.java
# Compile the client
javac ChatClient.javaIf compilation is successful, you should see Server.class and ChatClient.class files created in the directory.
Note: If you encounter any compilation errors, ensure:
- You're in the correct directory containing the .java files
- Java JDK is properly installed (not just JRE)
- Your JAVA_HOME environment variable is set correctly
The server must be started first before any clients can connect.
-
Run the Server
java Server
-
Server Console Output You should see:
Server started on port 1234 Waiting for connections... -
Find Your Server IP Address
Windows:
ipconfig
Look for "IPv4 Address" under your active network adapter (e.g.,
192.168.1.100)macOS:
ifconfig | grep "inet " # OR ipconfig getifaddr en0
Linux:
hostname -I # OR ip addr showYour LAN IP typically starts with
192.168.x.xor10.x.x.x -
Keep Server Running
- Do not close the server terminal/command prompt window
- The server must remain running for clients to stay connected
- You'll see connection messages as clients join
Once the server is running, launch clients on the same or different computers.
-
Run the Client Application
java ChatClient
-
Enter Username
- A dialog box will appear
- Enter your desired username (e.g., "Player1", "Alice", "Bob")
- Click "OK"
- Enter Server IP Address
- Another dialog will appear asking for the server IP
- If running on the same machine as server: Enter
localhost - If running on a different machine: Enter the server's IP address (e.g.,
192.168.1.100) - Click "OK"
- Connection Success
- You should see the main application window open
- Your username will appear in the users list
- The chat will show a "connected" message
- The server console will show your connection
Test the entire application on one computer to ensure everything works before trying multiple devices.
-
Open First Terminal/Command Prompt
cd path/to/LAN_Pictionary java ServerLeave this running.
-
Open Second Terminal/Command Prompt
cd path/to/LAN_Pictionary java ChatClient- Username:
User1 - Server IP:
localhost
- Username:
-
Open Third Terminal/Command Prompt (optional)
cd path/to/LAN_Pictionary java ChatClient- Username:
User2 - Server IP:
localhost
- Username:
-
Test Features
- ✅ Draw on one client, verify it appears on the other
- ✅ Send chat messages between clients
- ✅ Click "Clear Canvas" and verify both canvases clear
- ✅ Try voice call between User1 and User2 (note: calling yourself won't work)
- ✅ Check ping values in both clients
Expected Behavior:
- All drawing should sync in real-time
- Chat messages appear on all clients
- Canvas clear affects all connected clients
- Voice calls work between different client instances
- Users list updates when clients connect/disconnect
Test the application across different computers on your LAN.
-
Prepare Network
- Ensure all devices are connected to the same Wi-Fi network or LAN
- Disable any VPNs on all devices
- Temporarily disable firewalls if connection issues occur (remember to re-enable after testing)
-
Server Computer Setup
# On the computer that will host the server cd path/to/LAN_Pictionary java Server
- Note down this computer's IP address (use
ipconfig,ifconfig, orhostname -I) - Example IP:
192.168.1.100
- Note down this computer's IP address (use
-
Client Computer 1 Setup
# On second computer cd path/to/LAN_Pictionary java ChatClient
- Username:
Alice - Server IP:
192.168.1.100(use the server's actual IP)
- Username:
-
Client Computer 2 Setup
# On third computer cd path/to/LAN_Pictionary java ChatClient
- Username:
Bob - Server IP:
192.168.1.100(same as above)
- Username:
-
Client Computer 3 Setup (add as many as needed)
- Repeat the client setup with different usernames
- All clients use the same server IP address
| Feature | Test Steps | Expected Result |
|---|---|---|
| Connection | Launch clients from multiple devices | All clients connect successfully, appear in users list |
| Drawing Sync | Draw on one device | Drawing appears on all other devices in real-time |
| Tool Switching | Switch between pencil and eraser | Tool changes work correctly, erase properly removes drawings |
| Canvas Clear | Click Clear Canvas on one device | All canvases clear simultaneously |
| Group Chat | Send messages from different devices | All messages appear on all clients with correct usernames |
| Voice Call | Initiate call from Device A to Device B | Call notification appears, audio works both ways |
| Call Rejection | Decline an incoming call | Caller notified, both clients return to normal state |
| Call End | End an active call | Both clients return to normal state, can make new calls |
| Disconnect | Close one client | Other clients updated, user removed from list |
| Ping Monitor | Observe ping values | Ping stays low (<100ms on good LAN) and updates regularly |
Home Wi-Fi Network:
- All devices connected to same router
- Server IP typically:
192.168.1.xor192.168.0.x - Usually works without additional configuration
Office Network:
- May require admin permissions for server
- Firewall rules might need adjustment
- Check with IT department for port 1234 access
Mobile Hotspot:
- Enable hotspot on one device
- Connect all computers to the hotspot
- Hotspot device can also run server/client
- Server IP is the hotspot device's IP
Direct Ethernet Connection:
- Connect computers with Ethernet cable
- May need to manually assign IP addresses
- Example: Computer 1:
192.168.2.1, Computer 2:192.168.2.2
Pencil Tool
- Click the "Pencil" button to activate drawing mode
- Click and drag on the canvas to draw
- All connected users see your drawings in real-time
- Default color: Black
Eraser Tool
- Click the "Eraser" button to activate erase mode
- Click and drag to erase parts of the drawing
- Erased areas become white background
- Erasing is synchronized across all clients
Clear Canvas
- Click the "Clear Canvas" button
- Clears the entire canvas for all connected users
- Cannot be undone
- Use when starting a new drawing
Drawing Tips:
- Draw slowly on slower networks for better synchronization
- Use shorter strokes for more responsive drawing
- Eraser works best with slower movements
Sending Messages
- Type your message in the text field at the bottom
- Press Enter or click Send
- Your message appears in the chat with your username
- All connected users see the message instantly
Chat Features:
- Message history visible in scrollable chat area
- Timestamps for each message
- Username prefix shows who sent each message
- System messages for user joins/leaves
- Auto-scroll to latest messages
Chat Etiquette:
- Keep messages respectful
- Use chat for coordination during drawing
- Announce when you're clearing the canvas
Making a Call
- Locate the user you want to call in the users list
- Click the phone icon (:telephone_receiver:) next to their username
- Wait for the other user to accept or decline
- If accepted, the call window opens with "End Call" button
Receiving a Call
- A call notification dialog appears with caller's name
- Click "Accept" to answer the call
- Click "Decline" to reject the call
- If you accept, the call window opens
During a Call
- Speak normally into your microphone
- Audio is transmitted in real-time
- Click "End Call" button to terminate the call
- Closing the call window also ends the call
Call Limitations:
- Only one-on-one calls supported (no conference calls)
- Cannot call yourself
- Can only be in one call at a time
- Other users cannot call you while you're already in a call
Audio Tips:
- Use headphones to prevent echo
- Speak clearly and avoid background noise
- Test microphone before important calls
- Adjust system volume for best audio quality
Users List
- Shows all connected users in real-time
- Phone icon appears next to each username
- Click phone icon to initiate call
- List updates when users join or leave
Ping Monitor
- Displays current connection latency
- Updates every few seconds
- Lower ping = better connection
- High ping (>200ms) may cause lag
Problem: Client cannot connect to server
Solutions:
- Verify server is running and showing "Waiting for connections..."
- Check IP address is correct
- Use
localhostonly if on same machine as server - Use actual LAN IP for different machines
- Use
- Ensure all devices are on the same network
- Temporarily disable firewalls:
- Windows: Windows Defender Firewall
- macOS: System Preferences → Security & Privacy → Firewall
- Linux:
sudo ufw disable(remember to re-enable)
- Check if port 1234 is available:
# Windows netstat -ano | findstr :1234 # macOS/Linux lsof -i :1234
- Try restarting the server
Problem: "Connection refused" error
Solutions:
- Server might not be running
- Wrong IP address entered
- Firewall blocking port 1234
- Network isolation (guest network mode)
Problem: Drawing doesn't sync across clients
Solutions:
- Check network connection quality
- Verify all clients are connected (check users list)
- Try drawing more slowly
- Restart affected client
- Check server console for errors
Problem: Drawing is laggy or delayed
Solutions:
- High network latency (check ping monitor)
- Too many users connected
- Server computer may be slow
- Draw with shorter strokes
- Close unnecessary applications
Problem: No audio during call
Solutions:
- Check microphone permissions:
- Windows: Settings → Privacy → Microphone
- macOS: System Preferences → Security & Privacy → Microphone
- Linux: Check PulseAudio/ALSA settings
- Verify microphone is not muted
- Test microphone in other applications
- Check system volume levels
- Restart the application
- Try different microphone device
Problem: Echo or feedback during call
Solutions:
- Use headphones instead of speakers
- Reduce microphone sensitivity
- Increase distance between microphone and speakers
- Lower system volume
Problem: Cannot initiate call
Solutions:
- Verify user is online in users list
- Ensure you're not already in a call
- Check if target user is already in a call
- Restart client application
Problem: Application crashes or freezes
Solutions:
- Check Java version:
java -version(needs 11+) - Increase Java heap memory:
java -Xmx512m ChatClient
- Check server console for errors
- Restart application
- Update Java to latest version
Problem: High CPU usage
Solutions:
- Close unused client instances
- Reduce number of connected clients
- Clear canvas to reduce rendering load
- Restart server periodically
Problem: Port already in use
Solution:
# Find process using port 1234
# Windows
netstat -ano | findstr :1234
taskkill /PID <process_id> /F
# macOS/Linux
lsof -ti:1234 | xargs kill -9Windows Firewall:
# Run as Administrator
netsh advfirewall firewall add rule name="LAN Pictionary" dir=in action=allow protocol=TCP localport=1234macOS Firewall:
- System Preferences → Security & Privacy → Firewall → Firewall Options
- Add Java to allowed applications
Linux (UFW):
sudo ufw allow 1234/tcp- Protocol: TCP/IP sockets
- Server Port: 1234
- Drawing Protocol: Coordinate streaming
- Voice Protocol: Raw audio packet streaming
- Chat Protocol: Text message broadcasting
- Java Swing for GUI
- Java Socket Programming for networking
- javax.sound.sampled for audio capture/playback
- Multi-threading for concurrent connections
- Event-driven architecture
- Bandwidth: ~10 KB/s per client (idle), ~50 KB/s during voice call
- Latency: <100ms recommended for smooth experience
- Ports: TCP 1234 (server), ephemeral ports (clients)
- Maximum recommended clients: 20 (depends on server hardware)
- Voice calls: One-on-one only (no conference)
- Drawing canvas: Fixed size
- No drawing history/undo feature
- No user authentication
- No persistent storage
- Run server on most powerful computer
- Use wired Ethernet when possible
- Minimize network traffic from other applications
- Close unnecessary background applications
- Limit number of simultaneous voice calls
Contributions are welcome! Here's how you can help:
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Color picker for drawing
- Adjustable brush size
- Drawing shapes (circle, rectangle, line)
- Undo/redo functionality
- Save/load drawings
- User authentication
- Conference voice calls
- Private chat messages
- Drawing permissions (host controls)
- Better mobile support
This project is open source and available under the MIT License.
If you encounter issues or have questions:
- Check the Troubleshooting section
- Review GitHub Issues
- Create a new issue with:
- Detailed problem description
- Steps to reproduce
- System information (OS, Java version)
- Error messages/screenshots
- Built with Java Swing
- Inspired by classic Pictionary gameplay
- Created for LAN party entertainment
Enjoy drawing with friends! 🎨 📞
For updates and more projects, visit github.com/madesh405

















