Add Swing-based GUI for the Number Guessing Game#65
Merged
Conversation
Co-authored-by: Project516 <138796702+Project516@users.noreply.github.com>
Co-authored-by: Project516 <138796702+Project516@users.noreply.github.com>
Co-authored-by: Project516 <138796702+Project516@users.noreply.github.com>
Project516
approved these changes
Oct 22, 2025
Copilot
AI
changed the title
[WIP] Add GUI for playing the game
Add Swing-based GUI for the Number Guessing Game
Oct 22, 2025
Project516
approved these changes
Oct 22, 2025
Project516
added a commit
that referenced
this pull request
Feb 23, 2026
Add Swing-based GUI for the Number Guessing Game
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds a complete graphical user interface (GUI) for the Number Guessing Game using Java Swing, as requested in #[issue_number]. The game now launches with a modern, user-friendly GUI by default, while maintaining backward compatibility with the console mode.
Screenshot
What's New
🎮 GUI Mode (Default)
💻 Console Mode Preserved
The classic console interface remains available using the
--consoleor-cflag:Technical Details
Implementation
GUIclass extendsJFramefollowing Swing best practicesBoxLayoutfor responsive, cross-platform designSwingUtilities.invokeLater()RandomNumber,CheckGuess,GameInfo)Files Changed
Testing
Cross-Platform Compatibility
The GUI is designed to work seamlessly across Windows, macOS, and Linux:
Usage
GUI Mode (Default):
Console Mode:
Documentation
The README has been updated with:
Resolves #[issue_number]
Original prompt
Fixes #19
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.