0

I am making a game. On the first screen, its just asking for all of the details but i don't want the actual game visible in the background. How do i set it so all the stuff in the back isn't visible and the opening bit, and as soon as the user presses play, it all becomes visible. I assume you would use "earnings.setVisible(true); but its already true, how do i get it so it starts off with false when i load the gui up. Or is there a better way of approaching this issue? New window maybe?

Dullah
  • 53
  • 1
  • 8
  • There are a number possible solutions, you could use a modal dialog to gather the details from the user, you could use the glass pane to add a component over the top of the current window. Generally, I'd avoid using a second window – MadProgrammer Jan 08 '16 at 00:56
  • For an example of [using a glassPane](http://stackoverflow.com/questions/17310838/floating-jpanel-above-a-jpanel-with-borderlayout/17310869#17310869) – MadProgrammer Jan 08 '16 at 00:59
  • I'd do two JPanels. One would be the options menu, and once they're all added, I'd remove the options JPanel and add the game JPanel. There would just be 1 JFrame. setVisible makes the JFrame visible or invisible, and you should only do that if you want two completely seperate windows. – James McDowell Jan 08 '16 at 00:59

0 Answers0