Java Chess RMI is a desktop chess application built with Java Swing and Java RMI. The project combines a visual chessboard, object-oriented game logic for chess pieces, turn validation, check/checkmate detection, and a small remote server that synchronizes the game state between two players.
- Interactive 8x8 Swing chessboard with custom square components
- Object-oriented model for chess pieces: king, queen, rook, bishop, knight and pawn
- Move validation implemented per piece type
- Turn-based gameplay with white/black player assignment
- Check and checkmate detection
- Castling support with movement-state tracking
- Legal move highlighting in the UI
- Java RMI server for shared board state, move submission and turn synchronization
- Board versioning so clients can refresh only when the remote state changes
The project is split into two main areas:
src/scacchi: chess domain model, Swing UI, board rendering and user interactionsrc/Server: RMI contract and server implementation
The client connects to an RMI registry on localhost:1099, registers as either the white or black player, sends moves to the server and periodically refreshes the board when the server version changes.
ChessGame: central game engine for turns, moves, check, checkmate and castlingChessBoard: board representation and piece placementPieceand subclasses: movement rules for each chess pieceChessGameGUI: Swing interface for the playable boardChessGameServer: remote server that owns the shared game stateChessGameInterface: RMI interface used by the clients
- Java
- Swing
- Java RMI
- NetBeans project structure
- Open the project in NetBeans.
- Start the RMI server by running
Server.ChessGameServer. - Start one or two clients by running
scacchi.ChessGameGUI. - The first client is assigned white, the second client is assigned black.
This is a school project focused on implementing chess logic and network synchronization from scratch. Some UI text and comments are still in Italian because the original project was developed in an Italian school context.