← Back to Projects

Lottery Game - Keno

A JavaFX-based simulation of the Keno lottery game featuring interactive gameplay, animations, and results

JavaFXJava

About This Project

This project simulates the casino and state lottery game Keno using Java and JavaFX. Players select how many numbers to play, choose their picks manually or automatically, and decide how many drawings to participate in. During each drawing, numbers are revealed one at a time with pauses to simulate real gameplay. The application uses multiple JavaFX scenes to guide the user from a welcome screen to gameplay while providing clear prompts and feedback throughout the experience. All game logic is separated from the UI and thoroughly tested using unit tests, ensuring correctness and maintainability.

Key Features

  • Interactive number selection using a grid-based bet card
  • Multiple game modes (1, 4, 8, or 10 number spots)
  • Automatic number selection option
  • Animated number drawings with pause transitions
  • Multiple JavaFX scenes and menu options
  • Light/Dark blue theme options
  • JUnit-tested game logic
  • Logic/calculations based on North Carolina state lottery winning and odds --> https://nclottery.com/KenoHow

Technologies Used

  • IDE: IntelliJ
  • Java
  • JavaFX
  • Maven
  • JUnit 5

Challenges & Learnings

Challenges:

A major challenge was designing an intuitive and responsive JavaFX interface without using FXML or CSS. Managing user input validation—such as preventing illegal number selections—required careful event-driven logic. Coordinating game flow across multiple drawings while maintaining clear feedback for the user also required thoughtful state management.

What I Learned:

This project improved my skills in event-driven programming and JavaFX GUI development. I learned how to manage complex user interactions, control application flow, and provide real-time feedback to users. Additionally, writing extensive unit tests for the game logic reinforced best practices for separating UI from core functionality.

This project was created in October 2025