title: Trouble with JOptionPane and getting it to work
body: <p>trying to create a joptionpane to work any ideas why this isnt working?</p>
  
  <pre><code>public void playerLost() {
  
      if(player.getStaminaLevel() &lt; player.getStaminaNeededToMove(Terrain.SAND)) {
  
                  JOptionPane.YES_NO_OPTION(
  
          if (JOptionPane.NO_OPTION) {
              dispose();
          }
          else
          {
              game = new Game();
              createGridSquarePanels();
              update();
          }
  }
  </code></pre>
  
  <p>i also tried this but says JOptionPane.NO_OPTION cannot be converted from int to string</p>
  
  <pre><code>    public void playerLost() {
  
      if(player.getStaminaLevel() &lt; player.getStaminaNeededToMove(Terrain.SAND)) {
          int choice = JOptionPane.showConfirmDialog(
          this, 
                  "sorry you lost\nWould you like to restart?",
                  JOptionPane.YES_NO_OPTION,
                  JOptionPane.INFORMATION_MESSAGE);
          if (choice == JOptionPane.NO_OPTION) {
              dispose();
          }
          else
          {
              game = new Game();
              createGridSquarePanels();
              update();
          }
  }
  }
  </code></pre>