title: Display pop-up message window in Java?
body: <p>I read about JDialogs and JOptionPane messages but I still can't get it to work. I have a GUI class that extends JFrame. All I want to do is have a popup at the beginning of my program which informs the user about a couple of things. In my main I create the following gui:</p>
  
  <pre><code>GUI g = new GUI();
  </code></pre>
  
  <p>Right after that I was to display the window. I have tried the following in the main method:</p>
  
  <pre><code>JOptionPane.showMessageDialog(g, "work?");
  JOptionPane.showMessageDialog(frame, "work?"); //(frame was used in documentation example so I tried it)
  </code></pre>
  
  <p>I also tried to add the pop up into the GUI class with the following</p>
  
  <pre><code>JOptionPane.showMessageDialog(this, "work?"); //(I'm not exactly sure what the Frame Owner parameter is supposed to be, unless I'm confusing this with JDialog.)
  </code></pre>
  
  <p>In any case, how would I make this window appear? Every single one of the methods I tried compiled, and nothing happened.</p>
  
  <pre><code>public class GUI extends JFrame implements ActionListener{
       private Container background;
       private static buttons etc...
       private static JLabel disp,edisp;
       private static JTextArea info;
       //setting up the GUI for my program, adding action listeners, I can post more if    necessary
  }
  </code></pre>
  
  <p>And then I have the main where I want to call the pop up window </p>
  
  <pre><code>public static void main(String[] args){
      GUI g = new GUI();
      JOptionPane.showMessageDialog(g,"Work?");
  }
  </code></pre>