-1

I am working on a Rock Paper Scissors Game and am wondering how I would make a Dialog Box pop up every time the program is launched. This is what the main JFrame looks like:

enter image description here

This is what I want to pop up when the program is launched:

enter image description here

Is there any way I can make the Dialog Box pop up when you run the program?

1 Answers1

4

What you really want is a JOptionPane that can be customized like the Dialog Box you showed. You can see a related answer here:

Java - How to create a custom dialog box?

Community
  • 1
  • 1
João Martins
  • 332
  • 2
  • 10
  • Martins Okay I will try that, but do you have any idea as to how I'd make it appear when the program is initially launched? – spencerbro12 Jun 16 '16 at 23:47
  • I would have to look at the code, but try to do it before the main JFrame is launched. So you can get the popup, on the click of "Let's play" you store the score limit and launch the main JFrame then. – João Martins Jun 16 '16 at 23:50
  • I was able to get the window to pop up now but for some reason it appears in the top right of my screen and it is minimized, any idea on how you may change the size? – spencerbro12 Jun 17 '16 at 00:07
  • Actually scratch that I got it to resize, but now it's not displaying over the main JFrame. – spencerbro12 Jun 17 '16 at 00:09
  • [link](http://docs.oracle.com/javase/7/docs/api/java/awt/Window.html#setAlwaysOnTop%28boolean%29) This should work. If my answer was useful please dont forget to upvote and accept the answer :) – João Martins Jun 17 '16 at 00:31