Good day!
I am doing a game in Java. My menu button includes New Game, HighScore, About and Quit. But before the user can proceed to the main game, he needs to type his name first. I used this code as follows:
private void btnNewGameMouseClicked(java.awt.event.MouseEvent evt) {
Player p1 = new Player();
this.setVisible(false); // I must replace this code
p1.setVisible(true);
}
My problem is, I don't want to make the main menu hidden. I want it to freeze and cannot be accessed when the player name is being asked.
My Main menu frame is bigger than the player frame.. Of course, I can just delete the code this.setVisible(false)
but the problem is I can still access the main menu when clicked... I want the main menu to freeze and cannot be accessed when the player frame pops up.. (See image below) Please help me. Thank you.