title: JOptionPane close frame on No button
body: <p>I have this code snippet on a JOptionPane. I wanted to open another frame when the Yes button is clicked and close the frame when either No or Cancel is clicked. </p>
  
  <p>Before I set the case 1 and case 2 to System.exit(0); the case 0 works perfectly fine because it successfully opens another frame. But when I put system.exit to both case 1 and 2 when the Yes button is clicked it still closes the frame. </p>
  
  <pre><code>int test = JOptionPane.showConfirmDialog(null, "You lost! Play again?");
  
           switch(test) {
               case 0:  RPS rps = new RPS();
                          rps.setVisible(true);
                          this.dispose(); //Yes option
               case 1: System.exit(0); //No option
               case 2: System.exit(0); //Cancel option
             }
  </code></pre>
  
  <p>What did I do wrong? </p>