Skip to content

PerfectPoH/java-chess-rmi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Chess RMI

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.

Highlights

  • 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

Architecture

The project is split into two main areas:

  • src/scacchi: chess domain model, Swing UI, board rendering and user interaction
  • src/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.

Main Classes

  • ChessGame: central game engine for turns, moves, check, checkmate and castling
  • ChessBoard: board representation and piece placement
  • Piece and subclasses: movement rules for each chess piece
  • ChessGameGUI: Swing interface for the playable board
  • ChessGameServer: remote server that owns the shared game state
  • ChessGameInterface: RMI interface used by the clients

Tech Stack

  • Java
  • Swing
  • Java RMI
  • NetBeans project structure

How to Run

  1. Open the project in NetBeans.
  2. Start the RMI server by running Server.ChessGameServer.
  3. Start one or two clients by running scacchi.ChessGameGUI.
  4. The first client is assigned white, the second client is assigned black.

Notes

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.

About

Java Swing chess application with RMI multiplayer synchronization, full piece movement rules, turn handling, legal move highlighting, check/checkmate detection and castling support.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages