'Java Swing - How can I make a frame "mandatory to interact with"?

I'm making a game in Java Swing. Every time the player levels up I display a new frame on top of the one containing the gameplay which has some options on what rewards to get for having leveled up. Due to the nature of my rewards being able to skip choosing some of the upgrades could break the game, so I want to ensure that the user can only resume playing by clicking on one of the 1-3 buttons displayed in the level-up frame.

I have the frame set to undecorated and to appear always on top, but nothing's stopping the user from clicking outside of it to the main gameplay panel and simply pressing esc to resume playing. Instead I want it so the user can only click on the level-up frame out of the 2.
Is there an easy setting I can toggle for this, or do I have to remove remove my keyboard input listener from the first panel to achieve this?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source