Package mastermind.gui.panels
Class HomeButton
java.lang.Object
mastermind.gui.panels.HomeButton
A class to create a home button that will take the user back to GameModeSelector.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
drawHomeButton
(JFrame frame) Draw the home button on the frame.static void
registerHomeHandlers
(JFrame frame) Register the home button handler.
-
Method Details
-
registerHomeHandlers
Register the home button handler. This method adds an action listener to the home button that creates a new GameModeSelector frame. It ensures that the handler is only registered once by checking the isHandlerRegistered flag.- Parameters:
frame
- Frame of the program.
-
drawHomeButton
Draw the home button on the frame. This method adds the button panel (containing the home button) to the specified frame.- Parameters:
frame
- Frame of the program.
-