title: Using Boolean True/False with JOptionPane.YES_NO_OPTION
body: <p>I have a series of four yes/no choices in four separate dialog boxes, the cumulative results of which will lead to one of twelve separate links (e.g., Yes/Yes/Yes/No -> link A, Yes/No/No/Yes -> link B, etc). The branching logic uses boolean values.</p>
  
  <p>Here's what I have so far...just the first dialog box and printing the results for validation. </p>
  
  <pre><code>public class OutageGuideSelector{
      public static void main(String[] args){
          boolean contactServerUp;
          boolean vistaUp;
          boolean stormOutage;
          boolean vistaCSUp;
  //
          int contactServerEntry = JOptionPane.showConfirmDialog(null,
                                   "Is the contact server up", "Please select",
                                   JOptionPane.YES_NO_OPTION);
          System.out.println("result from entry " + contactServerEntry);
          if(contactServerEntry==1) 
             contactServerUp = true;
          else
            if(contactServerEntry==0)
               contactServerUp = false; 
          /* System.out.println(contactServerUp); */
         }}
  </code></pre>
  
  <p>Right now, the results of clicking YES reults in a <code>0</code> being returned, NO results in a <code>1</code>. Is this normal, seems counterintuitive, and there's nothing at docs.oracle.java that shows a clear example of the output values except <a href="http://docs.oracle.com/javase/1.4.2/docs/api/constant-values.html#javax.swing.JOptionPane.YES_NO_OPTION" rel="nofollow"><em>this</em></a> which seems to suggest that the <code>public static final int YES_NO_OPTION</code> default in 0.   </p>
  
  <p>Additionally, the line <code>System.out.println(contactServerUp);</code> comes back with an error that the field <code>contactServerUp might not have been initialized</code> when I un-comment it, so I can't see if my convert-int-to-boolean is working.</p>
  
  <p>First: It appears that JOptionPane method does not include any boolean returns...except <code>getWantsInput()</code> which returns the value of the wantsInput property...so I assume I'm already being the most efficient I can with this. I'd like to know if there's an easier way.</p>
  
  <p>Second, what am I missing that prevents my console output statement from recognizing the <code>contactServerUp</code>? Where's my misplaced semicolon?  </p>