Skip to content

Lamorsa44/TicTacToe-JavaSwing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Desktop Tic‑Tac‑Toe

A simple desktop Tic‑Tac‑Toe (X/O) game with a clean Swing GUI. You can play Human vs Human, Human vs Robot, Robot vs Human, or Robot vs Robot. The app provides a menu to select player modes, a start/reset button, and a status label indicating the game state.

Features

  • 3×3 board with clickable cells
  • Player modes selectable from the Game menu:
    • Human vs Human
    • Human vs Robot
    • Robot vs Human
    • Robot vs Robot
  • Start/Reset button to begin or restart a round
  • Status label showing current player and outcomes (win/draw)
  • Exit option in the menu

Technologies Used

  • Java (configured via Gradle toolchains)
  • Java Swing and AWT for the GUI playerOptionMove

Project Structure

  • /src/tictactoe — main source code (Swing UI and game logic)
    • ApplicationRunner.java — entry point (launches the Swing app)
    • TicTacToe.java — main window (frame, menus, and layout)
    • Board.java, ButtonStartReset.java, ButtonPlayer.java, StatusLabel.java, Player.java, PlayerOption.java, Status.java

How to Run

Option A — from an IDE :

  1. Open the project in IntelliJ IDEA (or any Java IDE).
  2. Locate /src/tictactoe/ApplicationRunner.java.
  3. Run the main method. The Tic‑Tac‑Toe window should appear.

Images

Starting Game

img.png

Playing

img_1.png

Win

img_2.png

Notes

  • The UI is built with standard Swing components; no external GUI libraries are required.
  • Player “Robot” is a simple automated opponent implemented within the project logic that selects a random empty cell.

About

Simple TicTacToe game made with Java Swing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages